Changeset 14230 in genesis for tools/gformat.py
- Timestamp:
- Nov 21, 2018, 9:11:45 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r14206 r14230 716 716 if ifacedump.has_key('ether'): 717 717 flags_if[ifname]['ether'] = ifacedump['ether'] 718 719 # Handle special interface states 720 flags_if[ifname]['status'] = ifacedump['status'] 718 721 719 722 # Add interface IP to list … … 998 1001 output += "# %s || %s || %s\n" % (iface, addr, comment) 999 1002 1003 prefix = '' 1004 if flags_if[iface]['status'] == 'broken': 1005 output += "# Interface %s disabled since status=broken\n" % iface 1006 prefix = '#' 1007 1000 1008 # Write DHCLIENT entry 1001 1009 if iface in dhclient_if and dhclient_if[iface]: 1002 output += "ifconfig_%s='SYNCDHCP'\n\n" % (iface)1010 output += prefix + "ifconfig_%s='SYNCDHCP'\n\n" % (iface) 1003 1011 continue 1004 1012 … … 1011 1019 ) 1012 1020 1021 1013 1022 idx_offset = 0 1014 1023 # Set MAC is required 1015 1024 if flags_if[iface].has_key('ether'): 1016 output += "ifconfig_%s='link %s'\n" % (iface, flags_if[iface]['ether'])1017 output += "ifconfig_%s_alias0='inet %s'\n" % (iface, addrs[0][0])1025 output += prefix + "ifconfig_%s='link %s'\n" % (iface, flags_if[iface]['ether']) 1026 output += prefix + "ifconfig_%s_alias0='inet %s'\n" % (iface, addrs[0][0]) 1018 1027 idx_offset += 1 1019 1028 elif iface in bridge_list: 1020 output += "ifconfig_%s_alias0='inet %s'\n" % (iface, addrs[0][0])1029 output += prefix + "ifconfig_%s_alias0='inet %s'\n" % (iface, addrs[0][0]) 1021 1030 idx_offset += 1 1022 1031 else: 1023 output += "ifconfig_%s='inet %s'\n" % (iface, addrs[0][0])1032 output += prefix + "ifconfig_%s='inet %s'\n" % (iface, addrs[0][0]) 1024 1033 1025 1034 for idx, addr in enumerate(addrs[1:]): 1026 output += "ifconfig_%s_alias%s='inet %s'\n" % (iface, idx + idx_offset, addr[0])1035 output += prefix + "ifconfig_%s_alias%s='inet %s'\n" % (iface, idx + idx_offset, addr[0]) 1027 1036 1028 1037 output += "\n"
Note:
See TracChangeset
for help on using the changeset viewer.