Bug 1474513 - Using --old-chroot, selinux plugin crashes if yum is not installed
Using --old-chroot, selinux plugin crashes if yum is not installed
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: mock (Show other bugs)
26
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Suchý
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-24 15:59 EDT by David Shea
Modified: 2017-08-23 06:29 EDT (History)
6 users (show)

See Also:
Fixed In Version: mock-1.4.3-1.fc26 mock-1.4.3-1.fc25 mock-1.4.3-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-10 12:55:16 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description David Shea 2017-07-24 15:59:13 EDT
Description of problem:

If mock is run on a system with selinux enabled, and the yum package is not installed, mockbuild/plugins/selinux.py will crash as it attempts to load /usr/share/yum-cli/cli.py

INFO: mock.py version 1.4.2 starting (python version = 3.6.2)...
Start: init plugins
INFO: selinux enabled
ERROR: No module named 'cli'
Traceback (most recent call last):
  File "/usr/libexec/mock/mock", line 934, in <module>
    main()
  File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 96, in trace
    result = func(*args, **kw)
  File "/usr/libexec/mock/mock", line 703, in main
    buildroot = Buildroot(config_opts, uidManager, state, plugins, bootstrap_buildroot)
  File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 96, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.6/site-packages/mockbuild/buildroot.py", line 70, in __init__
    self.plugins.init_plugins(self)
  File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 96, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.6/site-packages/mockbuild/plugin.py", line 65, in init_plugins
    module.init(self, self.plugin_conf["{0}_opts".format(plugin)], buildroot)
  File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 96, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.6/site-packages/mockbuild/plugins/selinux.py", line 27, in init
    SELinux(plugins, conf, buildroot)
  File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 96, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.6/site-packages/mockbuild/plugins/selinux.py", line 56, in __init__
    if self._selinuxYumIsSetoptSupported():
  File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 96, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.6/site-packages/mockbuild/plugins/selinux.py", line 111, in _selinuxYumIsSetoptSupported
    import cli
ModuleNotFoundError: No module named 'cli'



Version-Release number of selected component (if applicable):
mock-1.4.2-1.fc26.noarch

How reproducible:
Always


Steps to Reproduce:
1. Setup system as noted above
2. mock --old-chroot -r fedora-26-x86_64 --buildsrpm --spec <spec> --sources $PWD
Comment 1 Miroslav Suchý 2017-08-06 18:01:22 EDT
Fixed in commit 1a2acb6
Comment 2 Fedora Update System 2017-08-06 19:46:33 EDT
mock-1.4.3-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-53f9c9cb51
Comment 3 Fedora Update System 2017-08-06 19:47:04 EDT
mock-1.4.3-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-204acb9aa4
Comment 4 Fedora Update System 2017-08-06 19:47:36 EDT
mock-1.4.3-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-4ee5b66a4c
Comment 5 Fedora Update System 2017-08-07 17:49:13 EDT
mock-1.4.3-1.el7 has been pushed to the Fedora EPEL 7 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-EPEL-2017-53f9c9cb51
Comment 6 Fedora Update System 2017-08-07 18:25:45 EDT
mock-1.4.3-1.fc25 has been pushed to the Fedora 25 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-2017-4ee5b66a4c
Comment 7 Fedora Update System 2017-08-07 21:23:42 EDT
mock-1.4.3-1.fc26 has been pushed to the Fedora 26 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-2017-204acb9aa4
Comment 8 Fedora Update System 2017-08-10 12:55:16 EDT
mock-1.4.3-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.
Comment 9 Fedora Update System 2017-08-22 08:48:46 EDT
mock-1.4.3-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.
Comment 10 Fedora Update System 2017-08-23 06:29:20 EDT
mock-1.4.3-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.