Created attachment 787759 [details] Distro file, works for RHEL6.4 Description of problem: Python exception in cobbler/utils.py on import of RHEL6.4 DVD Version-Release number of selected component (if applicable): 2.4.0-1.fc19 How reproducible: Always Steps to Reproduce: 1. cobbler import --name=rhel6.4 --path=/mnt/rhel-DVD 2. 3. Actual results: task started: 2013-08-18_184532_import task started (id=Media import, time=Sun Aug 18 18:45:32 2013) Found a candidate signature: breed=redhat, version=rhel6 Found a matching signature: breed=redhat, version=rhel6 Adding distros from path /var/www/cobbler/ks_mirror/TESTNG-x86_64: creating new distro: TESTNG-x86_64 Exception occured: <class 'cobbler.cexceptions.CX'> Exception value: 'invalid input type' Exception Info: File "/usr/local/src/cobbler/cobbler/remote.py", line 89, in run rc = self._run(self) File "/usr/local/src/cobbler/cobbler/remote.py", line 232, in runner self.logger File "/usr/local/src/cobbler/cobbler/api.py", line 925, in import_tree return import_module.run(path,mirror_name,network_root,kickstart_file,arch,breed,os_version) File "/usr/local/src/cobbler/cobbler/modules/manage_import_signatures.py", line 141, in run os.path.walk(self.path, self.distro_adder, distros_added) File "/usr/lib64/python2.7/posixpath.py", line 246, in walk walk(name, func, arg) File "/usr/lib64/python2.7/posixpath.py", line 246, in walk walk(name, func, arg) File "/usr/lib64/python2.7/posixpath.py", line 238, in walk func(arg, top, names) File "/usr/local/src/cobbler/cobbler/modules/manage_import_signatures.py", line 256, in distro_adder adtls.append(self.add_entry(dirname,kernel,initrd)) File "/usr/local/src/cobbler/cobbler/modules/manage_import_signatures.py", line 313, in add_entry distro.set_kernel_options(self.signature.get("kernel_options","")) File "/usr/local/src/cobbler/cobbler/item.py", line 177, in set_kernel_options (success, value) = utils.input_string_or_hash(options,allow_multiples=True) File "/usr/local/src/cobbler/cobbler/utils.py", line 584, in input_string_or_hash raise CX(_("invalid input type")) !!! TASK FAILED !!! Expected results: Cobbbler distro imported successfully Additional info: I have tracked down the "invalid input type" to be unicode which the function cannot handle The unicode options happens to have len = 0 If I modify line 546 if options is None or options == "delete" or len(options) == 0: // ignore unicode strings of len 0 the import succeeds. My import invokes utils.input_string_or_hash twice with unicode options.
Upstream: this looks like https://github.com/cobbler/cobbler/issues/528
This seems to have been fixed in upstream, vide the following code: if options == "<<inherit>>": options = {} if options is None or options == "delete": return (True, {}) elif isinstance(options, list): raise CX(_("No idea what to do with list: %s") % options) elif isinstance(options, str) or isinstance(options, unicode): new_dict = {} tokens = shlex.split(options) etc etc
Yes, the following patch fixes the issue: https://github.com/cobbler/cobbler/issues/528#issuecomment-22832421 Tested with cobbler-2.4.0-1.fc19.noarch # cobbler import --name=fedora19 --arch=x86_64 --path=/mnt/iso task started: 2013-10-16_225112_import task started (id=Media import, time=Wed Oct 16 22:51:12 2013) Found a candidate signature: breed=redhat, version=rhel6 Found a candidate signature: breed=redhat, version=fedora16 Found a candidate signature: breed=redhat, version=fedora17 Found a candidate signature: breed=redhat, version=fedora18 Found a candidate signature: breed=redhat, version=fedora19 Found a matching signature: breed=redhat, version=fedora19 Adding distros from path /var/www/cobbler/ks_mirror/fedora19-x86_64: creating new distro: fedora19-x86_64 trying symlink: /var/www/cobbler/ks_mirror/fedora19-x86_64 -> /var/www/cobbler/links/fedora19-x86_64 creating new profile: fedora19-x86_64 associating repos checking for rsync repo(s) checking for rhn repo(s) checking for yum repo(s) starting descent into /var/www/cobbler/ks_mirror/fedora19-x86_64 for fedora19-x86_64 processing repo at : /var/www/cobbler/ks_mirror/fedora19-x86_64 need to process repo/comps: /var/www/cobbler/ks_mirror/fedora19-x86_64 looking for /var/www/cobbler/ks_mirror/fedora19-x86_64/repodata/*comps*.xml running: createrepo -c cache -s sha --groupfile /var/www/cobbler/ks_mirror/fedora19-x86_64/repodata/bf4e62e367e9b80e4f7c75092ef729f69d5d8e2d3eadd3c852ba6c5eb7a85353-Fedora-19-comps.xml /var/www/cobbler/ks_mirror/fedora19-x86_64 received on stdout: Spawning worker 0 with 988 pkgs Spawning worker 1 with 987 pkgs Spawning worker 2 with 987 pkgs Spawning worker 3 with 987 pkgs Workers Finished Saving Primary metadata Saving file lists metadata Saving other metadata Generating sqlite DBs Sqlite DBs complete received on stderr: *** TASK COMPLETE ***
Hit this on f19 with a CentOS 6.5 spin. n.b. restart cobblerd to get the patch to take effect (that's probably obvious to many...) James, would you take a patch/SPEC revision on this to get cobbler working out-of-the-box on f19 again?
cobbler-2.4.3-1.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/cobbler-2.4.3-1.fc19
cobbler-2.4.3-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/cobbler-2.4.3-1.fc20
cobbler-2.4.4-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/cobbler-2.4.4-1.fc20
cobbler-2.4.4-1.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/cobbler-2.4.4-1.fc19
cobbler-2.4.4-1.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/cobbler-2.4.4-1.el6
cobbler-2.4.4-1.el5 has been submitted as an update for Fedora EPEL 5. https://admin.fedoraproject.org/updates/cobbler-2.4.4-1.el5
Package cobbler-2.4.4-1.el5: * should fix your issue, * was pushed to the Fedora EPEL 5 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=epel-testing cobbler-2.4.4-1.el5' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-EPEL-2014-1211/cobbler-2.4.4-1.el5 then log in and leave karma (feedback).
cobbler-2.4.4-1.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.
cobbler-2.4.4-1.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.
cobbler-2.4.4-1.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.
cobbler-2.4.4-1.el5 has been pushed to the Fedora EPEL 5 stable repository. If problems still persist, please make note of it in this bug report.