Got a repository error while composing a livecd: 00:02:22.248 Traceback (most recent call last): 00:02:22.248 File "/bin/livecd-creator", line 242, in <module> 00:02:22.249 sys.exit(main()) 00:02:22.249 File "/bin/livecd-creator", line 218, in main 00:02:22.249 creator.install() 00:02:22.249 File "/usr/lib/python2.7/site-packages/imgcreate/creator.py", line 675, in install 00:02:22.251 ayum.runInstall() 00:02:22.251 File "/usr/lib/python2.7/site-packages/imgcreate/yuminst.py", line 203, in runInstall 00:02:22.251 except yum.Errors.RepoError, e: 00:02:22.251 UnboundLocalError: local variable 'yum' referenced before assignment Looks like an "import yum" is missing. python-imgcreate-23.3-1.fc24.x86_64
How were you calling livecd-creator? yum gets imported at the top of yuminst.py so there should be no way for yum to be undefined.
(In reply to Brian Lane from comment #1) > How were you calling livecd-creator? yum gets imported at the top of > yuminst.py so there should be no way for yum to be undefined. Looks like you need to explicitly import yum.Errors. I reached that condition trying to add to a livecd a package with rich boolean dependencies (https://fedoraproject.org/wiki/Packaging:Guidelines#Rich.2FBoolean_dependencies) The triggering package for me is ovirt-engine from http://resources.ovirt.org/pub/ovirt-master-snapshot/rpm/fc24/ which includes the following require: Requires: (yum-plugin-versionlock if yum)
(opened a separate bug about it)
Does adding that help? Can you post a patch or a PR on https://github.com/rhinstaller/livecd-tools I can't see how this is happening. Both creator.py and yuminst.py import yum and when I try this manually I get this, which is what I'd expect: >>> from yum.Errors import YumBaseError >>> yum Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'yum' is not defined >>> yum.Errors Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'yum' is not defined >>> import yum >>> yum.Errors <module 'yum.Errors' from '/usr/lib/python2.7/site-packages/yum/Errors.pyc'> Obviously you're seeing it :) But I just can't figure out how it's possible for it to happen.
(In reply to Brian Lane from comment #4) > Does adding that help? Can you post a patch or a PR on > https://github.com/rhinstaller/livecd-tools https://github.com/rhinstaller/livecd-tools/pull/35 > I can't see how this is happening. Both creator.py and yuminst.py import yum > and when I try this manually I get this, which is what I'd expect: > > >>> from yum.Errors import YumBaseError > >>> yum > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > NameError: name 'yum' is not defined > >>> yum.Errors > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > NameError: name 'yum' is not defined > >>> import yum > >>> yum.Errors > <module 'yum.Errors' from '/usr/lib/python2.7/site-packages/yum/Errors.pyc'> > > > Obviously you're seeing it :) But I just can't figure out how it's possible > for it to happen. That would be nice to understand. Also importing yum.Errors at top level doesn't solve, in the PR I sent I had to import just before using it to have it working.
livecd-tools-23.4-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-0edc0e1794
livecd-tools-23.4-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-0edc0e1794
livecd-tools-23.4-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.
For what it's worth this issue also affects livecd-tools in CentOS 7. The patch provided at https://github.com/livecd-tools/livecd-tools/pull/35 appears to fix the problem.