diff --git a/src/hostinfo/ifconfig.py b/src/hostinfo/ifconfig.py index bb1811d0524dee96293af6876cb70d55157f5889..a6f0c2d31ef34606437eb60a9fc24112fd3cf174 100755 --- a/src/hostinfo/ifconfig.py +++ b/src/hostinfo/ifconfig.py @@ -30,6 +30,7 @@ def generate(tree, host): config += "BOOTPROTO=none\n" pass nameservers = [] + search = [] for s, ip in map(lambda ip: (subnet(tree, ip.address[0]), ip), filter(lambda ip: (ip.address[0] and subnet(tree, ip.address[0]) and @@ -42,6 +43,9 @@ def generate(tree, host): config += "%sNETMASK%s=%s\n" % (pre, index, s.netmask[0]) config += "%sNETWORK%s=%s\n" % (pre, index, s.network[0]) config += "%sBROADCAST%s=%s\n" % (pre, index, s.broadcast[0]) + if ip.search[0]: + search.extend(ip.search[0].split()) + pass for n in re.split("[, ]+", s.name_servers[0]): # Domain nameservers if not n in nameservers: @@ -69,6 +73,9 @@ def generate(tree, host): config += "DNS%d=%s\n" % (index, n) pass pass + if search: + config += 'SEARCH="%s"\n' % (" ".join(search)) + pass result.append(("ifcfg-%s" % d, config)) pass pass