Bug 1194171

Summary: mock exits with traceback: NameError: global name 'name' is not defined
Product: [Fedora] Fedora Reporter: Tomáš Hozza <thozza>
Component: mockAssignee: Miroslav Suchý <msuchy>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 21CC: bugs.michael, itamar, jdisnard, kdudka, mebrown, msimacek, msuchy, praiskup, williams, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: mock-1.2.10-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-05-01 16:51:32 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 Tomáš Hozza 2015-02-19 09:24:01 UTC
Description of problem:
Running the following command causes mock to end with traceback:
mock --rebuild <path_to_SRPM> --root rhel-6.7-candidate-x86_64 --no-cleanup-after

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

How reproducible:
always

Steps to Reproduce:
1. run "mock --rebuild <path_to_SRPM> --root rhel-6.7-candidate-x86_64 --no-cleanup-after"


Actual results:
$ mock --rebuild <path_to_SRPM> --root rhel-6.7-candidate-x86_64 --no-cleanup-after 
ERROR: Could not find required config file: /etc/mock/rhel-6.7-candidate-x86_64.cfg
ERROR: global name 'name' is not defined
Traceback (most recent call last):
  File "/usr/sbin/mock", line 829, in <module>
    main()
  File "/usr/lib/python2.7/site-packages/mockbuild/trace_decorator.py", line 84, in trace
    result = func(*args, **kw)
  File "/usr/sbin/mock", line 588, in main
    config_opts = util.load_config(config_path, options.chroot, uidManager, __VERSION__, PKGPYTHONDIR)
  File "/usr/lib/python2.7/site-packages/mockbuild/trace_decorator.py", line 84, in trace
    result = func(*args, **kw)
  File "/usr/lib/python2.7/site-packages/mockbuild/util.py", line 1013, in load_config
    do_update_config(log, config_opts, chroot_cfg_path, uidManager, skipError=False)
  File "/usr/lib/python2.7/site-packages/mockbuild/trace_decorator.py", line 84, in trace
    result = func(*args, **kw)
  File "/usr/lib/python2.7/site-packages/mockbuild/util.py", line 980, in do_update_config
    if name == "default":
NameError: global name 'name' is not defined

Expected results:
No traceback, just an error message

Additional info:

Comment 1 Miroslav Suchý 2015-02-19 13:04:13 UTC
Fixed in:
* 168954d  pass variable "name" [RHBZ#1194171]

Comment 2 Mikhail Campos 2015-02-27 14:03:30 UTC
*** Bug 1196902 has been marked as a duplicate of this bug. ***

Comment 3 Michael Schwendt 2015-03-16 15:51:48 UTC
Same here with:

  mock --rebuild some.src.rpm -r sometypo

Comment 4 Itamar Reis Peixoto 2015-04-20 13:49:00 UTC
anyone can tell me wheres the fix for this bug ?

Comment 6 Itamar Reis Peixoto 2015-04-20 14:41:33 UTC
Can you rebuild the packages and submit updates with this fix ?

Comment 7 Miroslav Suchý 2015-04-20 15:12:04 UTC
I am fixing other BZs and I will release it when mock is ready to be released. ETA is approx. one week.

Comment 8 Fedora Update System 2015-04-29 13:17:10 UTC
mock-1.2.8-1.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/mock-1.2.8-1.fc22

Comment 9 Fedora Update System 2015-04-29 13:17:33 UTC
mock-1.2.8-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/mock-1.2.8-1.fc21

Comment 10 Fedora Update System 2015-04-29 13:18:29 UTC
mock-1.2.8-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.2.8-1.fc20

Comment 11 Fedora Update System 2015-04-29 13:19:40 UTC
mock-1.2.8-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/mock-1.2.8-1.el7

Comment 12 Fedora Update System 2015-04-29 13:26:12 UTC
mock-1.2.8-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.2.8-1.el6

Comment 13 Fedora Update System 2015-04-29 19:19:25 UTC
Package mock-1.2.8-1.el7:
* should fix your issue,
* was pushed to the Fedora EPEL 7 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing mock-1.2.8-1.el7'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2015-6057/mock-1.2.8-1.el7
then log in and leave karma (feedback).

Comment 14 Fedora Update System 2015-05-01 16:51:32 UTC
mock-1.2.8-1.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2015-05-02 18:09:11 UTC
mock-1.2.8-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2015-05-12 20:46:54 UTC
mock-1.2.8-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 17 Fedora Update System 2015-06-04 11:42:36 UTC
mock-1.2.10-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/mock-1.2.10-1.el7

Comment 18 Fedora Update System 2015-06-04 11:42:39 UTC
mock-1.2.10-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.2.10-1.el6

Comment 19 Fedora Update System 2015-06-20 21:10:13 UTC
mock-1.2.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.

Comment 20 Fedora Update System 2015-06-20 21:13:53 UTC
mock-1.2.10-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.