From 51b288623d9191f58073bbf76d9beb9bf70cf5b5 Mon Sep 17 00:00:00 2001 From: Anders Blomdell <anders.blomdell@control.lth.se> Date: Fri, 3 Oct 2008 12:58:37 +0200 Subject: [PATCH] Version 2008-10-03 12:58 M src/hostinfo/ifconfig.py --- src/hostinfo/ifconfig.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/hostinfo/ifconfig.py b/src/hostinfo/ifconfig.py index 4f5d9f8..24c83cd 100755 --- a/src/hostinfo/ifconfig.py +++ b/src/hostinfo/ifconfig.py @@ -19,7 +19,7 @@ def generate(tree, host): s = subnet(tree, i.ip[0]) else: s = i._static_[0] - + config += "BOOTPROTO=none\n" config += "IPADDR=%s\n" % i.ip[0] if s and s.gateway[0] and s.gateway[0] != i.ip[0]: @@ -30,6 +30,13 @@ def generate(tree, host): config += "NETWORK=%s\n" % s.network[0] if s and s.broadcast[0]: config += "BROADCAST=%s\n" % s.broadcast[0] + if s and s.name_servers[0]: + ni = 0 + for n in re.split("[, ]+", s.name_servers[0]): + ni += 1 + config += "DNS%d=%s\n" % (ni, n) + if s and s.domain[0]: + config += "DOMAIN=%s\n" % s.domain[0] else: config += "BOOTPROTO=dhcp\n" result.append(("ifcfg-%s" % d, config)) -- GitLab