Bug 1159794

Summary: invalid legal_host_arches option can cause unclear output
Product: [Fedora] Fedora Reporter: Mikhail Campos <Mikhail_Campos-Guadamuz>
Component: mockAssignee: Miroslav Suchý <msuchy>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: rawhideCC: jdisnard, mebrown, msimacek, msuchy, praiskup, williams
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: mock-1.2.3-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-12 04:07:56 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:
Attachments:
Description Flags
fix for unclear legal host output none

Description Mikhail Campos 2014-11-03 11:05:08 UTC
Created attachment 953076 [details]
fix for unclear legal host output

Description of problem:
When we are changing 'legal_host_arches' config option to something incorrect, mock will fail with strange and helpless output.

Version-Release number of selected component (if applicable):
1.2.0-1

Steps to Reproduce:
1. Change 'legal_host_arches' option from ('x86_64',) to ('x86-64',) for fedora-20-x86_64.cfg
2. mock --rebuild --root=fedora-20-x86_64 /path/to/src/rpm

Actual results:
Output is: 'ERROR: Cannot build target x86_64 on arch x86_64'

Expected results:
Some output to help figure out what is wrong

Proposed patch:
Just tell user to check config option. Patch attached.

Comment 1 Miroslav Suchý 2014-11-03 13:42:57 UTC
Thanks for report.
I was unable to convience to accept git-am your patch. And I had to rewrite it. And when I was rewriting I reworded it it little bit. The error message now state:
ERROR: Cannot build target x86_64 on arch x86_64, because it is not listed in legal_host_arches ('x86-64',)

-            "Cannot build target %s on arch %s" % (target_arch, host_arch))
+            "Cannot build target {0} on arch {1}, because it is not listed in legal_host_arches {2}".format(target_arch, host_arch, legal))


Commited as f81458b

Comment 2 Mikhail Campos 2014-11-03 14:22:41 UTC
(In reply to Miroslav Suchý from comment #1)
> Thanks for report.
> I was unable to convience to accept git-am your patch. 

That's because I used 'git show HEAD' instead of 'git format-patch', sorry for this.

Comment 3 Fedora Update System 2014-11-16 17:37:22 UTC
mock-1.2.1-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/mock-1.2.1-1.fc21

Comment 4 Fedora Update System 2014-11-16 17:38:46 UTC
mock-1.2.1-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.2.1-1.fc20

Comment 5 Fedora Update System 2014-11-16 17:39:37 UTC
mock-1.2.1-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/mock-1.2.1-1.el7

Comment 6 Fedora Update System 2014-11-16 17:40:36 UTC
mock-1.2.1-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.2.1-1.el6

Comment 7 Fedora Update System 2014-11-17 06:29:42 UTC
Package mock-1.2.1-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mock-1.2.1-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-15217/mock-1.2.1-1.fc20
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2014-12-04 12:07:01 UTC
mock-1.2.3-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/mock-1.2.3-1.fc21

Comment 9 Fedora Update System 2014-12-04 12:10:30 UTC
mock-1.2.3-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.2.3-1.fc20

Comment 10 Fedora Update System 2014-12-04 12:11:27 UTC
mock-1.2.3-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/mock-1.2.3-1.el7

Comment 11 Fedora Update System 2014-12-12 04:07:56 UTC
mock-1.2.3-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 12 Fedora Update System 2014-12-17 04:43:00 UTC
mock-1.2.3-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 13 Fedora Update System 2015-01-06 02:06:44 UTC
mock-1.2.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.