~free.ekanayaka/landscape-client/jaunty-1.5.4-0ubuntu0.9.04.0

« back to all changes in this revision

Viewing changes to landscape/lib/network.py

  • Committer: Free Ekanayaka
  • Date: 2010-08-04 20:06:59 UTC
  • Revision ID: free.ekanayaka@canonical.com-20100804200659-w6rqbjz6wg9w3npc
* New upstream version (LP: #610744):
  - The Eucalyptus management plugin reports the output of the
    'euca-describe-availability-zones verbose' command, which includes
    information about the available instance types and the maximum
    number of each instance type that the cloud can support (LP: #599338)
  - Check if the package directory exists before trying to check the
    package changer lock in the dbus-proxy. This fixes a bug when upgrading
    a dbus-landscape which never registered (LP: #603514).
  - Allow an LDS server to bootstrap new cloud instances with its own CA,
    which is picked up by the client, written to a file on the instance, and
    used in subsequent exchanges with the server (LP: #605079).
  - Skip loopback interface when reporting device info (LP: #608314)
  - Disable landscape-sysinfo when load is more than 1 (LP: #608278)

Show diffs side-by-side

added added

removed removed

Lines of Context:
130
130
    return struct.unpack("H", data[16:18])[0]
131
131
 
132
132
 
133
 
def get_active_device_info():
 
133
def get_active_device_info(skipped_interfaces=("lo",)):
134
134
    """
135
135
    Returns a dictionary containing information on each active network
136
136
    interface present on a machine.
138
138
    results = []
139
139
    sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_IP)
140
140
    for interface in get_active_interfaces(sock):
 
141
        if interface in skipped_interfaces:
 
142
            continue
141
143
        interface_info = {"interface": interface}
142
144
        interface_info["ip_address"] = get_ip_address(sock, interface)
143
145
        interface_info["mac_address"] = get_mac_address(sock, interface)