Changeset 10366 in genesis for tools


Ignore:
Timestamp:
Apr 7, 2012, 10:08:14 AM (13 years ago)
Author:
rick
Message:

DHCLIENT configuration done the proper way...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/gformat.py

    r10365 r10366  
    410410  addrs_list = { 'lo0' : [("127.0.0.1/8", "LocalHost"), ("172.31.255.1/32","Proxy IP")] }
    411411  iface_map = {'lo0' : 'lo0'}
     412  dhclient_if = {'lo0' : False}
    412413
    413414  masterip_used = False
     
    423424    ifname = ifacedump['autogen_ifname']
    424425
    425     # Write DHCLIENT entry
    426     if ifacedump.has_key('dhcpclient') and ifacedump['dhcpclient']:
    427       output += "ifconfig_%s='SYNCDHCP'" % ifacedump['autogen_ifname']
     426    # Flag dhclient is possible
     427    dhclient_if[ifname] = ifacedump.has_key('dhcpclient') and ifacedump['dhcpclient']
    428428
    429429    # Add interface IP to list
     
    475475    for addr, comment in sorted(addrs,key=lambda x: parseaddr(x[0].split('/')[0])):
    476476      output += "# %s || %s || %s\n" % (iface, addr, comment)
    477     output += "ipv4_addrs_%s='%s'\n\n" % (iface, " ".join([x[0] for x in addrs]))
     477
     478    # Write DHCLIENT entry
     479    if dhclient_if[iface]:
     480      output += "ifconfig_%s='SYNCDHCP'\n\n" % (iface)
     481    else:
     482      output += "ipv4_addrs_%s='%s'\n\n" % (iface, " ".join([x[0] for x in addrs]))
    478483
    479484  return output
Note: See TracChangeset for help on using the changeset viewer.