Bug 1063275
Summary: | Undeclared variable causing traceback | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Tomas Kopecek <tkopecek> | ||||||
Component: | mock | Assignee: | Clark Williams <williams> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
Severity: | unspecified | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | 20 | CC: | mebrown, tkopecek, williams | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | mock-1.1.38-1.el6 | Doc Type: | Bug Fix | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2014-04-09 13:18:35 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: |
|
Created attachment 878308 [details]
revised patch to fix undefined variable in try/finally
I like this one a little better. What do you think?
mock-1.1.37-1.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/mock-1.1.37-1.fc19 mock-1.1.37-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/mock-1.1.37-1.fc20 mock-1.1.37-1.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/mock-1.1.37-1.el6 Package mock-1.1.37-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.37-1.el6' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-EPEL-2014-0960/mock-1.1.37-1.el6 then log in and leave karma (feedback). My patch was focused to case when exception is raised before self.start(chroot). (My case, some directories can't be mounted in test env). So self.start is not called and self.finish yes in your patch. Does it make sense? In such case it will raise: mockbuild.exception.StateError, "state finish mismatch: current: %s, state: %s" % (current, state) (not tested, just looking to code now) mock-1.1.37-2.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/mock-1.1.37-2.fc20 mock-1.1.37-2.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/mock-1.1.37-2.fc19 mock-1.1.37-2.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/mock-1.1.37-2.el6 Ah, good point. I'll look at it and we can put whatever we agree on into the 1.1.38 build. How about we lift that self.start(chrootstate) out of the try block? diff --git a/py/mockbuild/backend.py b/py/mockbuild/backend.py index 8ed7d48..b56d28d 100644 --- a/py/mockbuild/backend.py +++ b/py/mockbuild/backend.py @@ -813,12 +813,12 @@ from mockbuild.trace_decorator import traceLog, decorate, getLog self._resetLogging() self._callHooks("prechroot") chrootstate = "chroot %s" % args + self.start(chrootstate) try: self._setupDirs() self._setupDev() self._setupFiles() self._mountall() - self.start(chrootstate) if options.unpriv: self.doChroot(args, shell=shell, printOutput=True, uid=self.chrootuid, gid=self.chrootgid, cwd=options.cwd) So clear, that I've missed this solution :-) I'm for this one. Good, this is now queued for testing in 1.1.38 Ugh, I meant 1.1.37-2. Sorry and that last patch didn't make it into the build. Argh. I'll push a 1.1.38 build with that last bit when we finally get 1.1.37 through testing. mock-1.1.38-1.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/mock-1.1.38-1.fc19 mock-1.1.38-1.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/mock-1.1.38-1.el6 mock-1.1.38-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/mock-1.1.38-1.fc20 mock-1.1.38-1.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report. mock-1.1.38-1.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report. mock-1.1.38-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. |
Created attachment 861354 [details] patch Code of cleanup phase in backend.py (in finally:) uses variable chrootstate which is not declared yet (error occurs before it), so causing chained traceback. Fix is testing if variable is set before using it. Patch is self-explanatory oneliner. Tested build: mock-1.1.36-1.fc20 Patch against ebce599dca50c7c306aba7be631b1eb03febe9ec