Changeset 10904 in genesis for tools/syntax-checker.py


Ignore:
Timestamp:
May 18, 2012, 9:48:21 PM (13 years ago)
Author:
rick
Message:

Show which rev is dying.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/syntax-checker.py

    r10820 r10904  
    1616    for host in gformat.get_hostlist():
    1717      print "## Processing host %-20s: " % host,
    18       datadump = gformat.get_yaml(host)
    19       iface_keys = [elem for elem in datadump.keys() if (elem.startswith('iface_') and not "lo0" in elem)]
    20       for iface_key in iface_keys:
    21         l = datadump[iface_key]['ip']
    22         addr, mask = l.split('/')
     18      datadump = gformat.get_yaml(host,add_version_info=False)
     19      try:
     20        iface_keys = [elem for elem in datadump.keys() if (elem.startswith('iface_') and not "lo0" in elem)]
     21        for iface_key in iface_keys:
     22          l = datadump[iface_key]['ip']
     23          addr, mask = l.split('/')
    2324
    24         label = "%s - %s" % (host, iface_key)
    25         if pool.has_key(addr):
    26           pool[addr] += [label]
    27         else:
    28           pool[addr] = [label]
    29       print "OK"
    30   except (KeyError, ValueError), e:
    31     print "[ERROR] in '%s' interface '%s' (%s)" % (host,iface_key, e)
     25          label = "%s - %s" % (host, iface_key)
     26          if pool.has_key(addr):
     27            pool[addr] += [label]
     28          else:
     29            pool[addr] = [label]
     30        print "OK"
     31      except (KeyError, ValueError), e:
     32        print "[ERROR] in '%s' interface '%s' (%s)" % (host,iface_key, e)
     33        raise
     34  except Exception as e:
    3235    raise
    3336    sys.exit(1)
Note: See TracChangeset for help on using the changeset viewer.