diff --git a/src/hostinfo/dhcpd.py b/src/hostinfo/dhcpd.py index 6b9b0875ab6625a2644aa44e8af419e67e25c0ad..000378c88ab6d56a1f66c6048ff933b8b97e22ce 100755 --- a/src/hostinfo/dhcpd.py +++ b/src/hostinfo/dhcpd.py @@ -7,8 +7,9 @@ def conf(tree, dhcphost): # emit = False for ds in tree._host_._interface_._dhcpserver_: - if ds.name[0:] == dhcphost: + if dhcphost in ds.name[0::1]: # Given host is a nameserver + dhcphost = ds.name[0:] emit = True if not emit: diff --git a/src/hostinfo/ifconfig.py b/src/hostinfo/ifconfig.py index 8e6841508162abfbbcd2e0c960af26068d688e67..04732dcaafd323b3f3ed4bff1e775e29e3c74ccb 100755 --- a/src/hostinfo/ifconfig.py +++ b/src/hostinfo/ifconfig.py @@ -13,10 +13,12 @@ def generate(tree, host): config += "HWADDR=%s\n" % i.ethernet[0].upper() config += "ONBOOT=yes\n" config += "TYPE=Ethernet\n" - if not i._dhcpserver_: - config += "BOOTPROTO=dhcp\n" - else: - s = subnet(tree, i.ip[0]) + if i._dhcpserver_ or i._static_: + if i._dhcpserver_: + 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]: @@ -27,6 +29,8 @@ def generate(tree, host): config += "NETWORK=%s\n" % s.network[0] if s and s.broadcast[0]: config += "BROADCAST=%s\n" % s.broadcast[0] + else: + config += "BOOTPROTO=dhcp\n" result.append(("ifcfg-%s" % d, config)) return result diff --git a/src/hostinfo/parser.py b/src/hostinfo/parser.py index 46e0ab87252a4b1d588375e558760edb0c2d84d5..8be620b46dd2881107b09d2729889da762dc6021 100755 --- a/src/hostinfo/parser.py +++ b/src/hostinfo/parser.py @@ -238,7 +238,7 @@ class AttributeAccessor: # Return first declaration within range # attr[start:stop] node = self._node - i= 0 + i = 0 while node and i < last: if i >= first: try: @@ -270,9 +270,9 @@ class AttributeAccessor: if index.step == None: # Return first declaration within range # attr[start:stop] - (next,last,stride) = index.indices(sys.maxint) + (next,last,stride) = index.indices(10000) node = self._node - i= 0 + i = 0 while node and i < last: if i >= next: try: @@ -285,7 +285,7 @@ class AttributeAccessor: else: # Return all declaration within range result = [] - (next,last,stride) = index.indices(sys.maxint) + (next,last,stride) = index.indices(10000) node = self._node i= 0 while node and i < last: diff --git a/src/hostinfo/yp.py b/src/hostinfo/yp.py index db5fcaeb364ef66b373b3099ff157fa7ede9ed1a..3761cf5471a578b438d6101e2c09533b42599d36 100755 --- a/src/hostinfo/yp.py +++ b/src/hostinfo/yp.py @@ -60,6 +60,14 @@ def netgroup(tree): except: netgroup[g.name[0:]] = [ entry ] + for k in tree._host_._interface_._kickstart_: + if k._parent.ip[0:]: + entry = "(%s,,)" % fqn(tree, k._parent)[0:-1] + try: + netgroup["ks-%s" % k.file[0:]].append(entry) + except: + netgroup["ks-%s" % k.file[0:]] = [ entry ] + result = "" keys = netgroup.keys() keys.sort()