-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
James Cammarata wrote:
> On Fri, 20 Mar 2009 12:45:38 -0400, Michael DeHaan <mdehaan(a)redhat.com>
> wrote:
>
>> James Cammarata wrote:
>>
>>> Ran sync and hit this traceback:
>>>
>>> # cobbler sync
>>> Extracting cabinet:
>>> /var/www/cobbler/ks_mirror/windows2k3-i386/i386/startrom.n1_
>>> extracting /tftpboot/profiles/windows2k3-i386/startrom.n12
>>>
>>> All done, no errors.
>>> Extracting cabinet:
>>> /var/www/cobbler/ks_mirror/windows2k3-i386/i386/setupldr.ex_
>>> extracting /tftpboot/profiles/windows2k3-i386/setupldr.exe
>>>
>>> All done, no errors.
>>>
>>> 'NoneType' object has no attribute 'get_assigned_address'
>>> 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
>>> 384,
>>> in get_ip_address
>>> return net.get_assigned_address(self.name, interface)
>>>
>>>
>>> This is from the devel branch only.
>>>
>>> It looks like the net object returned by the search is not checked to
>>> make
>>> sure it is valid, the patch below does this:
>>>
>>> diff --git a/cobbler/item_system.py b/cobbler/item_system.py
>>> index 4a056a9..dbc0cac 100644
>>> --- a/cobbler/item_system.py
>>> +++ b/cobbler/item_system.py
>>> @@ -381,7 +381,10 @@ class System(item.Item):
>>> return intf["ip_address"].strip()
>>> elif intf["subnet"] != "":
>>> net =
self.config.networks().find(name=intf["subnet"])
>>> - return net.get_assigned_address(self.name, interface)
>>> + if net:
>>> + return net.get_assigned_address(self.name, interface)
>>> + else:
>>> + return ""
>>> else:
>>> return ""
>>>
>>>
>>>
>>>
>> github branches merged, thanks!
>>
> I found this one at work, and can't push to my github from here. I can fix
> that when I get home, otherwise you'll have to patch that the old fashioned
> way.
>
>
I will fix this now and push it; it is related to network objects and
you shouldn't have to be concerned with it unless you are explicitly
using them.
- --
John Eckersberg
IT Engineering Support
Red Hat, Inc.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora -
http://enigmail.mozdev.org
iEYEARECAAYFAknDzbYACgkQdxt4pd4ztYtO3wCfYicLvJU1wqoy0pUrf3Td6u9z
PKsAniseV7habEy63VCwEOxOlJ2A+KVl
=xsQs
-----END PGP SIGNATURE-----