Changeset 8319 in genesis for nodes/gformat.py
- Timestamp:
- Aug 12, 2010, 2:32:45 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
nodes/gformat.py
r8317 r8319 28 28 ] 29 29 30 # Global variables uses 31 OK = 0 32 UNKNOWN = 1 33 DOWN = 2 30 34 31 35 … … 289 293 290 294 295 def get_interface_keys(config): 296 """ Quick hack to get all interface keys, later stage convert this to a iterator """ 297 return [elem for elem in config.keys() if (elem.startswith('iface_') and not "lo0" in elem)] 298 291 299 292 300 def get_used_ips(configs): 293 301 """ Return array of all IPs used in config files""" 294 302 ip_list = [] 295 for host,config in configs.iteritems():303 for config in configs: 296 304 ip_list.append(config['masterip']) 297 iface_keys = [elem for elem in config.keys() if (elem.startswith('iface_') and not "lo0" in elem)] 298 for iface_key in iface_keys: 305 for iface_key in get_interface_keys(config): 299 306 l = config[iface_key]['ip'] 300 307 addr, mask = l.split('/')
Note:
See TracChangeset
for help on using the changeset viewer.