-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of James Cammarata
Sent: 17 April 2012 12:46
To: cobbler mailing list
Subject: Re: [cobbler] Help required with - Exception value: 'NoneType' object 
has no attribute 'update'

On Tue, Apr 17, 2012 at 5:26 AM, Simon Nicoll <[email protected]> 
wrote:
> Hi,
>
>
>
> Can a Cobbler guru help me with this problem...
>
>
>
> ·         OS = Centos 6.2
>
> ·         cobbler-2.2.1-1.el6.noarch
>
> ·         cobbler-web-2.2.1-1.el6.noarch
>
>
>
> Nothing installed within Cobbler i.e. fresh install
>
>
>
> [root@buildbox kickstarts]# service cobblerd restart
>
> Stopping cobbler daemon:                                   [  OK  ]
>
> Starting cobbler daemon:                                   [  OK  ]
>
>
>
> [root@buildbox kickstarts]# cobbler check
>
> The following are potential configuration items that you may want to fix:
>
> 1 : debmirror package is not installed, it will be required to manage 
> debian deployments and repositories
>
> Restart cobblerd and then run 'cobbler sync' to apply changes.
>
>
>
> [root@buildbox kickstarts]# cobbler report (it’s empty)
>
>
>
> distros:
>
> ==========
>
>
>
> profiles:
>
> ==========
>
>
>
> systems:
>
> ==========
>
>
>
> mgmtclasses:
>
> ==========
>
>
>
> packages:
>
> ==========
>
>
>
> files:
>
> ==========
>
>
>
> repos:
>
> ==========
>
>
>
> images:
>
> ==========
>
>
>
> Does it sync - Yup
>
>
>
> [root@buildbox kickstarts]# cobbler sync
>
> task started: 2012-04-17_023706_sync
>
> task started (id=Sync, time=Tue Apr 17 02:37:06 2012)
>
> running pre-sync triggers
>
> cleaning trees
>
> removing: /var/www/cobbler/images/CentOS6-2-x86_64
>
> removing: /var/lib/tftpboot/pxelinux.cfg/default
>
> removing: /var/lib/tftpboot/grub/grub-x86_64.efi
>
> removing: /var/lib/tftpboot/grub/efidefault
>
> removing: /var/lib/tftpboot/grub/grub-x86.efi
>
> removing: /var/lib/tftpboot/grub/images
>
> removing: /var/lib/tftpboot/images/CentOS6-2-x86_64
>
> removing: /var/lib/tftpboot/s390x/profile_list
>
> copying bootloaders
>
> trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> 
> /var/lib/tftpboot/grub/grub-x86_64.efi
>
> trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> 
> /var/lib/tftpboot/grub/grub-x86.efi
>
> copying distros to tftpboot
>
> copying images
>
> generating PXE configuration files
>
> generating PXE menu structure
>
> rendering DHCP files
>
> generating /etc/dhcp/dhcpd.conf
>
> rendering TFTPD files
>
> generating /etc/xinetd.d/tftp
>
> cleaning link caches
>
> rendering Rsync files
>
> running post-sync triggers
>
> running python triggers from /var/lib/cobbler/triggers/sync/post/*
>
> running python trigger cobbler.modules.sync_post_restart_services
>
> running: dhcpd -t -q
>
> received on stdout:
>
> received on stderr:
>
> running: service dhcpd restart
>
> received on stdout: Shutting down dhcpd: [  OK  ]
>
> Starting dhcpd: [  OK  ]
>
>
>
> received on stderr:
>
> running shell triggers from /var/lib/cobbler/triggers/sync/post/*
>
> running python triggers from /var/lib/cobbler/triggers/change/*
>
> running python trigger cobbler.modules.scm_track
>
> running shell triggers from /var/lib/cobbler/triggers/change/*
>
> *** TASK COMPLETE ***
>
> [root@buildbox kickstarts]#
>
>
>
> Good so import a distro (HERE COMES THE PROBLEM)
>
>
>
> [root@buildbox kickstarts]# cobbler import --path=/mnt 
> --name=CentOS6U2
> --arch=x86_64
>
>
>
> Blah…
>
> {snip}
>
> Blah…
>
> repodata/eba624e5fe8db1b4ebe2e0b0ac66565be3c909c34c46d4685f50bbe921763
> d3b-primary.sqlite.bz2
>
>      4670102 100%    9.44MB/s    0:00:00 (xfer#3862, to-check=1/3871)
>
> repodata/repomd.xml
>
>         4137 100%    8.54kB/s    0:00:00 (xfer#3863, to-check=0/3871)
>
>
>
> sent 4353444836 bytes  received 73440 bytes  37051219.37 bytes/sec
>
> total size is 4352603116  speedup is 1.00
>
>
>
> received on stderr:
>
> adding distros
>
> creating new distro: CentOS6U2-x86_64
>
> Exception occured: <type 'exceptions.AttributeError'>
>
> Exception value: 'NoneType' object has no attribute 'update' <<<<< ?
> everything I try to do gives this same error
>
> Exception Info:
>
>   File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 93, 
> in run
>
>     rc = self._run(self)
>
>    File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 
> 232, in runner
>
>     self.logger
>
>    File "/usr/lib/python2.6/site-packages/cobbler/api.py", line 759, 
> in import_tree
>
>     return
> manager.run(pkgdir,mirror_url,mirror_name,network_root,kickstart_file,
> rsync_flags,arch,breed,os_version)
>
>    File
> "/usr/lib/python2.6/site-packages/cobbler/modules/manage_import_redhat
> .py",
> line 267, in run
>
>     os.path.walk(self.path, self.distro_adder, distros_added)
>
>    File "/usr/lib64/python2.6/posixpath.py", line 236, in walk
>
>     walk(name, func, arg)
>
>    File "/usr/lib64/python2.6/posixpath.py", line 236, in walk
>
>     walk(name, func, arg)
>
>    File "/usr/lib64/python2.6/posixpath.py", line 228, in walk
>
>     func(arg, top, names)
>
>    File
> "/usr/lib/python2.6/site-packages/cobbler/modules/manage_import_redhat
> .py",
> line 511, in distro_adder
>
>     adtls.append(self.add_entry(dirname,kernel,initrd))
>
>    File
> "/usr/lib/python2.6/site-packages/cobbler/modules/manage_import_redhat
> .py",
> line 582, in add_entry
>
>     self.distros.add(distro,save=True)
>
>    File "/usr/lib/python2.6/site-packages/cobbler/collection.py", line 
> 316, in add
>
>     self.lite_sync.add_single_distro(ref.name)
>
>    File "/usr/lib/python2.6/site-packages/cobbler/action_litesync.py", 
> line 68, in add_single_distro
>
>     self.tftpd.add_single_distro(distro)
>
>    File
> "/usr/lib/python2.6/site-packages/cobbler/modules/manage_in_tftpd.py", 
> line 155, in add_single_distro
>
>     self.write_boot_files_distro(distro)
>
>    File
> "/usr/lib/python2.6/site-packages/cobbler/modules/manage_in_tftpd.py", 
> line 69, in write_boot_files_distro
>
>     target      = utils.blender(self.config.api, False, distro)
>
>    File "/usr/lib/python2.6/site-packages/cobbler/utils.py", line 668, 
> in blender
>
>     mgmt_parameters.update(results.get("ks_meta", {}))
>
>
>
> !!! TASK FAILED !!!

The error appears to be here in utils.py:

    mgmt_parameters = results.get("mgmt_parameters",{})
    mgmt_parameters.update(results.get("ks_meta", {}))
    results["mgmt_parameters"] = mgmt_parameters

So that means it's getting something from results for mgmt_parameters that is 
not a dictionary object.

I'm betting it's a settings issue, since the import modules don't touch that 
and it's using the default from settings. Make sure you have a line like this 
in your /etc/cobbler/settings file, and restart cobblerd if you change it:

mgmt_parameters:
   from_cobbler: 1

You can also delete the
/var/lib/cobbler/config/distros.d/CentOS6U2-x86_64.json file (stop cobblerd 
before doing so) to clear up the issues and re-import it after you fix the 
mgmt_parameters setting.
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler


Hi,

First thanks for the help,

OK so the lines you indicated are there already in the settings file and have 
not been changed at all...

# cobbler has a feature that allows for integration with config management
# systems such as Puppet.  The following parameters work in conjunction with
# --mgmt-classes  and are described in furhter detail at:
# https://fedorahosted.org/cobbler/wiki/UsingCobblerWithConfigManagementSystem
mgmt_classes: []
mgmt_parameters:
from_cobbler: 1

The second part...

You can also delete the
/var/lib/cobbler/config/distros.d/CentOS6U2-x86_64.json file (stop cobblerd 
before doing so) to clear up the issues and re-import it after you fix the 
mgmt_parameters setting.

The file CentOS6U2-x86_64.json  does not exist (probably because I cleaned up 
after the failure and removed the distro from Cobbler) 

[root@buildbox distros.d]# pwd
/var/lib/cobbler/config/distros.d
[root@buildbox distros.d]# ls -la
total 8
drwxr-xr-x.  2 root root 4096 Apr 17 03:55 .
drwxr-xr-x. 10 root root 4096 Apr 12 07:36 ..

Still get the same error :-(

Thanks

Sime

_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler

Reply via email to