Bug 498088
| Summary: | ipa --help throws traceback | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Retired] freeIPA | Reporter: | Michael Gregg <mgregg> | ||||
| Component: | ipa-admintools | Assignee: | Dmitri Pal <dpal> | ||||
| Status: | CLOSED UPSTREAM | QA Contact: | Chandrasekar Kannan <ckannan> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | low | ||||||
| Version: | 2.0 | CC: | benl, dpal, rcritten | ||||
| Target Milestone: | v2 release | Keywords: | Reopened | ||||
| Target Release: | --- | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2012-03-28 09:30:12 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: | |||||||
| Bug Depends On: | |||||||
| Bug Blocks: | 431020 | ||||||
| Attachments: |
|
||||||
Seems to be a python 2.4 issue. I can reproduce this on RHEL 5 but not in Fedora 9. I just emailed the fix to freeipa-devel, along with this email: Under Python2.4 SystemExit subclasses from Exception (rather than from BaseException like in Python2.5), so cli.run() was catching a SystemExit raised by optparse. This patch changes cli.run() so it catches all StandardError instead of all Exception. I've been pretty good about doing this correctly, but I guess I missed this one. To reiterate the correct use: all custom exceptions should subclass from StandardError instead of Exception, and if doing a catch-all try/except, you should almost always do an `except StandardError` instead of `except Exception`. See the exception class hierarchy at the bottom each of these pages: http://www.python.org/doc/2.4.4/lib/module-exceptions.html http://www.python.org/doc/2.5.4/lib/module-exceptions.html Created attachment 341658 [details]
One line patch to fix this problem
why have you closed the bug as "CLOSED/NOTABUG", after having attached a patch ?. Shouldn't you mark the bug MODIFIED ? Oops, my mistake. I can't seem to select "MODIFIED" now... any advice? Okay, now I can select "MODIFIED". master: 3f4a0a2d7739dc4355313742f4b996face344d7a *** Bug 498545 has been marked as a duplicate of this bug. *** |
Description of problem: ipa --help throws traceback Version-Release number of selected component (if applicable): ipa-server-2.0-2.20090428.el5ipa Steps to Reproduce: 1. run: ipa --help 2. 3. Actual results: ipa --help usage: ipa [options] options: -h, --help show this help message and exit -e KEY=VAL Set environment variable KEY to VAL -c FILE Load configuration from FILE -d, --debug Produce full debuging output -v, --verbose Produce more verbose output -a, --prompt-all Prompt for ALL values (even if optional) -n, --no-prompt Prompt for NO values (even if required) Traceback (most recent call last): File "/usr/bin/ipa", line 32, in ? cli.run(api) File "/usr/lib/python2.4/site-packages/ipalib/cli.py", line 679, in run api.log.exception('%s: %s', e.__class__.__name__, str(e)) AttributeError: 'API' object has no attribute 'log'