Skip to content
Snippets Groups Projects
Commit b11294a9 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Version 2007-01-24 12:19

M  src/hostinfo/dhcpd.py
M  src/hostinfo/ifconfig.py
M  src/hostinfo/parser.py
M  src/hostinfo/yp.py
parent 522ba9d6
Branches
Tags
No related merge requests found
...@@ -7,8 +7,9 @@ def conf(tree, dhcphost): ...@@ -7,8 +7,9 @@ def conf(tree, dhcphost):
# #
emit = False emit = False
for ds in tree._host_._interface_._dhcpserver_: for ds in tree._host_._interface_._dhcpserver_:
if ds.name[0:] == dhcphost: if dhcphost in ds.name[0::1]:
# Given host is a nameserver # Given host is a nameserver
dhcphost = ds.name[0:]
emit = True emit = True
if not emit: if not emit:
......
...@@ -13,10 +13,12 @@ def generate(tree, host): ...@@ -13,10 +13,12 @@ def generate(tree, host):
config += "HWADDR=%s\n" % i.ethernet[0].upper() config += "HWADDR=%s\n" % i.ethernet[0].upper()
config += "ONBOOT=yes\n" config += "ONBOOT=yes\n"
config += "TYPE=Ethernet\n" config += "TYPE=Ethernet\n"
if not i._dhcpserver_: if i._dhcpserver_ or i._static_:
config += "BOOTPROTO=dhcp\n" if i._dhcpserver_:
else:
s = subnet(tree, i.ip[0]) s = subnet(tree, i.ip[0])
else:
s = i._static_[0]
config += "BOOTPROTO=none\n" config += "BOOTPROTO=none\n"
config += "IPADDR=%s\n" % i.ip[0] config += "IPADDR=%s\n" % i.ip[0]
if s and s.gateway[0] and s.gateway[0] != i.ip[0]: if s and s.gateway[0] and s.gateway[0] != i.ip[0]:
...@@ -27,6 +29,8 @@ def generate(tree, host): ...@@ -27,6 +29,8 @@ def generate(tree, host):
config += "NETWORK=%s\n" % s.network[0] config += "NETWORK=%s\n" % s.network[0]
if s and s.broadcast[0]: if s and s.broadcast[0]:
config += "BROADCAST=%s\n" % s.broadcast[0] config += "BROADCAST=%s\n" % s.broadcast[0]
else:
config += "BOOTPROTO=dhcp\n"
result.append(("ifcfg-%s" % d, config)) result.append(("ifcfg-%s" % d, config))
return result return result
......
...@@ -270,7 +270,7 @@ class AttributeAccessor: ...@@ -270,7 +270,7 @@ class AttributeAccessor:
if index.step == None: if index.step == None:
# Return first declaration within range # Return first declaration within range
# attr[start:stop] # attr[start:stop]
(next,last,stride) = index.indices(sys.maxint) (next,last,stride) = index.indices(10000)
node = self._node node = self._node
i = 0 i = 0
while node and i < last: while node and i < last:
...@@ -285,7 +285,7 @@ class AttributeAccessor: ...@@ -285,7 +285,7 @@ class AttributeAccessor:
else: else:
# Return all declaration within range # Return all declaration within range
result = [] result = []
(next,last,stride) = index.indices(sys.maxint) (next,last,stride) = index.indices(10000)
node = self._node node = self._node
i= 0 i= 0
while node and i < last: while node and i < last:
......
...@@ -60,6 +60,14 @@ def netgroup(tree): ...@@ -60,6 +60,14 @@ def netgroup(tree):
except: except:
netgroup[g.name[0:]] = [ entry ] 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 = "" result = ""
keys = netgroup.keys() keys = netgroup.keys()
keys.sort() keys.sort()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment