Bug 670453 - mock doesn't work when using scm plugin
Summary: mock doesn't work when using scm plugin
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: rawhide
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: Clark Williams
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-18 10:50 UTC by Alexey Smirnov
Modified: 2013-01-10 06:25 UTC (History)
5 users (show)

Fixed In Version: mock-1.1.10-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-19 04:38:59 UTC


Attachments (Terms of Use)
Patch to fix the mock scm code (2.38 KB, patch)
2011-01-20 11:05 UTC, michael.gruener
no flags Details | Diff
Patch to fix ext_src_dir handling (972 bytes, patch)
2011-01-20 11:11 UTC, michael.gruener
no flags Details | Diff
Patch to fix the mock scm code (corrected) (13.26 KB, patch)
2011-01-20 13:19 UTC, michael.gruener
no flags Details | Diff

Description Alexey Smirnov 2011-01-18 10:50:20 UTC
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'

Comment 1 michael.gruener 2011-01-20 11:05:55 UTC
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.

Comment 2 michael.gruener 2011-01-20 11:11:41 UTC
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.

Comment 3 michael.gruener 2011-01-20 13:19:59 UTC
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).

Comment 4 Marko Myllynen 2011-01-27 13:08:24 UTC
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.

Comment 5 Clark Williams 2011-02-20 19:46:45 UTC
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.

Comment 6 Fedora Admin XMLRPC Client 2011-03-11 18:09:14 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 7 Clark Williams 2011-05-07 13:48:04 UTC
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

Comment 8 Fedora Update System 2011-05-13 20:32:48 UTC
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

Comment 9 Fedora Update System 2011-05-13 20:37:47 UTC
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

Comment 10 Fedora Update System 2011-05-13 20:42:03 UTC
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

Comment 11 Fedora Update System 2011-05-13 20:46:18 UTC
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

Comment 12 Fedora Update System 2011-05-13 20:50:35 UTC
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

Comment 13 Fedora Update System 2011-05-14 00:02:42 UTC
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).

Comment 14 Fedora Update System 2011-05-19 04:34:16 UTC
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.

Comment 15 Fedora Update System 2011-05-25 02:41:36 UTC
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.

Comment 16 Fedora Update System 2011-05-25 03:16:05 UTC
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.

Comment 17 Fedora Update System 2011-06-02 19:05:49 UTC
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.

Comment 18 Fedora Update System 2011-06-02 19:15:51 UTC
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.


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