Changeset 8333 in genesis for nodes/get-network-status.py


Ignore:
Timestamp:
Aug 12, 2010, 10:12:19 PM (14 years ago)
Author:
rick
Message:
  • Darn keys are sometimes not around. Seems like a fetch or SNMP fail
File:
1 edited

Legend:

Unmodified
Added
Removed
  • nodes/get-network-status.py

    r8332 r8333  
    210210      # Convert to proper MAC
    211211      mac = ":".join(["%02X" % int(x,16) for x in m.group(2).split(':')])
    212       print "## Local MAC %s [index:%s] -> %s" % (iface_descr[index], index, mac)
    213       status[host]['mac'][mac] = iface_descr[index]
    214       status[host]['iface'][iface_descr[index]] = mac
     212      if not iface_descr.has_key(index):
     213        print "## Index cannot be mapped to a key, available:"
     214        for index, value  in iface_descr.iteritems():
     215          print "## - %s [%s]" % (value, index)
     216      else:
     217        print "## Local MAC %s [index:%s] -> %s" % (iface_descr[index], index, mac)
     218        status[host]['mac'][mac] = iface_descr[index]
     219        status[host]['iface'][iface_descr[index]] = mac
    215220      mac_to_host[mac] = hostname
    216221 
Note: See TracChangeset for help on using the changeset viewer.