Bug 1474513

Summary: Using --old-chroot, selinux plugin crashes if yum is not installed
Product: [Fedora] Fedora Reporter: David Shea <dshea>
Component: mockAssignee: Miroslav Suchý <msuchy>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: jdisnard, mebrown, msimacek, msuchy, praiskup, williams
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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 16:55:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Shea 2017-07-24 19:59:13 UTC
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 22:01:22 UTC
Fixed in commit 1a2acb6

Comment 2 Fedora Update System 2017-08-06 23:46:33 UTC
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 23:47:04 UTC
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 23:47:36 UTC
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 21:49:13 UTC
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 22:25:45 UTC
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-08 01:23:42 UTC
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 16:55:16 UTC
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 12:48:46 UTC
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 10:29:20 UTC
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.