Bug 670453
| Summary: | mock doesn't work when using scm plugin | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Alexey Smirnov <unlinkat> | ||||||||
| Component: | mock | Assignee: | Clark Williams <williams> | ||||||||
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||
| Severity: | medium | Docs Contact: | |||||||||
| Priority: | low | ||||||||||
| Version: | rawhide | CC: | dcantrell, mebrown, myllynen, unlinkat, williams | ||||||||
| Target Milestone: | --- | ||||||||||
| Target Release: | --- | ||||||||||
| Hardware: | Unspecified | ||||||||||
| OS: | Unspecified | ||||||||||
| Whiteboard: | |||||||||||
| Fixed In Version: | mock-1.1.10-1.el6 | Doc Type: | Bug Fix | ||||||||
| Doc Text: | Story Points: | --- | |||||||||
| Clone Of: | Environment: | ||||||||||
| Last Closed: | 2011-05-19 04:38:59 UTC | Type: | --- | ||||||||
| Regression: | --- | Mount Type: | --- | ||||||||
| Documentation: | --- | CRM: | |||||||||
| Verified Versions: | Category: | --- | |||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||||
| Embargoed: | |||||||||||
| Attachments: |
|
||||||||||
Created attachment 474437 [details]
Patch to fix the mock scm code
I noticed the problems with the scm functions too. Seems like the scm.py module was integrated as if it was an plugin (stored in plugins/ directory, added to the config_opt['plugin'] list...) but the actual design of the code (not registering any hooks in scm.py and calling mock.scm.scmWorker directly in mock.py) contratict this.
The attached patch fixes this problem by making scm.py a normal mock module and removing the code treating scm.py as plugin.
Created attachment 474438 [details]
Patch to fix ext_src_dir handling
Second patch to fix the mock scm functions. Requires the scm-plugin-fix.patch to be applied previously.
scm.py used EXT_SRC_DIR (as found in the original mock-scm code) to reference the external source dir instead of self.ext_src_dir. The patch fixes this.
Created attachment 474460 [details]
Patch to fix the mock scm code (corrected)
Corrected the patch so that it will move scm.py from py/mock/plugins to py/mock/ (as the first patch _should_ have done it).
Thanks for the report - the issue was unfortunately mistakenly introduced as part of the some last minute changes to the SCM module before 1.1.8 release. I've sent a patch to Clark (basically the same as Michael attached above) to fix it. We're also discussing a fix for the SELinux plugin to make it work both when building multiple SRPMs and thus also building from SCM. The patch in commment 2 is also obviously correct and should be applied. and now that I've attempted to address the /dev/tty issue, I'll pull together the SCM fixes and hopefully get that straightened out. This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. I've undone the plugin fiasco I created and put this back to the way Marko first had it. Please check my 'work' branch in git if you want to see the changes. queued for 1.1.10/1.0.17 release next week mock-1.1.10-1.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc15 mock-1.1.10-1.fc14 has been submitted as an update for Fedora 14. https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc14 mock-1.0.17-1.el5 has been submitted as an update for Fedora EPEL 5. https://admin.fedoraproject.org/updates/mock-1.0.17-1.el5 mock-1.1.10-1.fc13 has been submitted as an update for Fedora 13. https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc13 mock-1.1.10-1.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/mock-1.1.10-1.el6 Package mock-1.1.10-1.el6: * should fix your issue, * was pushed to the Fedora EPEL 6 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=epel-testing mock-1.1.10-1.el6' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/mock-1.1.10-1.el6 then log in and leave karma (feedback). mock-1.1.10-1.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report. mock-1.1.10-1.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report. mock-1.1.10-1.fc13 has been pushed to the Fedora 13 stable repository. If problems still persist, please make note of it in this bug report. mock-1.0.17-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. mock-1.1.10-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. |
Description of problem: When using scm plugin mock fails: ... Traceback (most recent call last): File "/usr/sbin/mock", line 859, in <module> main(retParams) File "/usr/sbin/mock", line 704, in main scmWorker = mock.scm.scmWorker(log, config_opts['scm_opts'], chroot.__dict__['selinux']) AttributeError: 'module' object has no attribute 'scm' ... Version-Release number of selected component (if applicable): mock-1.1.8 How reproducible: Always. Steps to Reproduce: 1. Configure /etc/mock/site-defaults.cfg: ... config_opts['scm'] = True config_opts['scm_opts']['method'] = 'git' config_opts['scm_opts']['git_get'] = 'git clone SCM_BRN git://git.fedorahosted.org/git/SCM_PKG.git SCM_PKG' config_opts['scm_opts']['spec'] = 'SCM_PKG.spec' config_opts['scm_opts']['ext_src_dir'] = '/dev/null' config_opts['scm_opts']['write_tar'] = True ... 2. $ mock rebuild -r rhel-6-i386 --scm-enable --scm-option package=koji --scm-option branch=master INFO: mock.py version 1.1.8 starting... State Changed: init plugins INFO: selinux disabled State Changed: start ERROR: 'module' object has no attribute 'scm' Traceback (most recent call last): File "/usr/sbin/mock", line 859, in <module> main(retParams) File "/usr/sbin/mock", line 704, in main scmWorker = mock.scm.scmWorker(log, config_opts['scm_opts'], chroot.__dict__['selinux']) AttributeError: 'module' object has no attribute 'scm'