Just ran a cobbler sync after doing a "git pull" on my ris-devel branch,
and got this traceback:
'network'
File "/usr/lib/python2.4/site-packages/cobbler/cobbler.py", line 83, in
main
rc = BootCLI().run(sys.argv)
File "/usr/lib/python2.4/site-packages/cobbler/cobbler.py", line 61, in
run
return self.loader.run(args)
File "/usr/lib/python2.4/site-packages/cobbler/commands.py", line 122, in
run
return fn.run()
File "/usr/lib/python2.4/site-packages/cobbler/modules/cli_misc.py", line
201, in run
return self.api.sync(verbose=self.options.verbose)
File "/usr/lib/python2.4/site-packages/cobbler/api.py", line 588, in sync
return sync.run()
File "/usr/lib/python2.4/site-packages/cobbler/action_sync.py", line 123,
in run
self.pxegen.write_all_system_files(x)
File "/usr/lib/python2.4/site-packages/cobbler/pxegen.py", line 371, in
write_all_system_files
f1 = utils.get_config_filename(system,interface=name)
File "/usr/lib/python2.4/site-packages/cobbler/utils.py", line 206, in
get_config_filename
ip = sys.get_ip_address(interface)
File "/usr/lib/python2.4/site-packages/cobbler/item_system.py", line 382,
in get_ip_address
elif intf["network"] != "":
The problem seems to be that this chunk of code is trying to access the
"network" key, when it should be using the "subnet" key. I'm a
little
confused about the terminology of this, as the subnet mask and the network
of a system are not the same thing, if anything the network should be
calculated from the IP address and subnet if it is not specified. Or, vice
versa, have the subnet mask be calculated from the IP/network.
I haven't looked at this code much, but do we use a default subnet mask
based on the IP address class? If not, we probably should.
Anywho, the fix has been pushed up to my github repo, and the diff below is
for anyone else who may be having this issue in the mean time:
index 8ab8039..4a056a9 100644
--- a/cobbler/item_system.py
+++ b/cobbler/item_system.py
@@ -379,8 +379,8 @@ class System(item.Item):
if intf["ip_address"] != "":
return intf["ip_address"].strip()
- elif intf["network"] != "":
- net = self.config.networks().find(name=intf["network"])
+ elif intf["subnet"] != "":
+ net = self.config.networks().find(name=intf["subnet"])
return net.get_assigned_address(self.name, interface)
else:
return ""
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.