- Timestamp:
- Feb 14, 2013, 9:56:21 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r11738 r11739 587 587 588 588 # Flag dhclient is possible 589 if not dhclient_if [ifname]:589 if not dhclient_if.has_key(ifname) or dhclient_if[ifname] == False: 590 590 dhclient_if[ifname] = dhcp_type(ifacedump) == DHCP_CLIENT 591 591 … … 824 824 if dhclient_if[iface]: 825 825 output += "ifconfig_%s='SYNCDHCP'\n\n" % (iface) 826 else: 827 # Make sure the external address is always first as this is needed in the 828 # firewall setup 829 addrs = sorted(addrs,key=lambda x: x[0].split('.')[0], cmp=lambda x,y: cmp(1 if x == '172' else 0, 1 if y == '172' else 0)) 830 output += "ipv4_addrs_%s='%s'\n\n" % (iface, " ".join([x[0] for x in addrs])) 826 827 # Make sure the external address is always first as this is needed in the 828 # firewall setup 829 addrs = sorted( 830 [x for x in addrs if not '0.0.0.0' in x[0]], 831 key=lambda x: x[0].split('.')[0], 832 cmp=lambda x,y: cmp(1 if x == '172' else 0, 1 if y == '172' else 0) 833 ) 834 addr_str = " ".join([x[0] for x in addrs]) 835 output += "ipv4_addrs_%s='%s'\n\n" % (iface, addr_str) 831 836 832 837 rc_conf_local_cache[datadump['autogen_item']] = output
Note:
See TracChangeset
for help on using the changeset viewer.