Changeset 10904 in genesis for tools/syntax-checker.py
- Timestamp:
- May 18, 2012, 9:48:21 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/syntax-checker.py
r10820 r10904 16 16 for host in gformat.get_hostlist(): 17 17 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('/') 23 24 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: 32 35 raise 33 36 sys.exit(1)
Note:
See TracChangeset
for help on using the changeset viewer.