#6115 ipa command provides stack trace when provided with single hypen commands
Closed: fixed 8 months ago by rcritten. Opened 4 years ago by mbasti.

Ticket was cloned from Red Hat Bugzilla (product Red Hat Enterprise Linux 7): Bug 1357495

Description of problem:
If user provides commands such as following, then ipa command provides stack
trace instead of error message to user.


# ipa -verbose
Traceback (most recent call last):
  File "/usr/bin/ipa", line 32, in <module>
    cli.run(api)
  File "/usr/lib/python2.7/site-packages/ipalib/cli.py", line 1346, in run
    api.log.exception('%s: %s', e.__class__.__name__, str(e))
AttributeError: 'API' object has no attribute 'log'

# ipa -ver
Traceback (most recent call last):
  File "/usr/bin/ipa", line 32, in <module>
    cli.run(api)
  File "/usr/lib/python2.7/site-packages/ipalib/cli.py", line 1346, in run
    api.log.exception('%s: %s', e.__class__.__name__, str(e))
AttributeError: 'API' object has no attribute 'log'

# ipa -e aa
Traceback (most recent call last):
  File "/usr/bin/ipa", line 32, in <module>
    cli.run(api)
  File "/usr/lib/python2.7/site-packages/ipalib/cli.py", line 1346, in run
    api.log.exception('%s: %s', e.__class__.__name__, str(e))
AttributeError: 'API' object has no attribute 'log'


Version-Release number of selected component (if applicable):
ipa-server-4.2.0-15.el7_2.17.x86_64

How reproducible:
100%

Steps to Reproduce:
1. ipa -verbose # or
2. ipa -e aa # or
3. ipa -ver

Actual results:
IPA command provides stack traces

Expected results:
IPA command should provide user friendly information about unknown command

Metadata Update from @mbasti:
- Issue assigned to someone
- Issue set to the milestone: FreeIPA 4.5 backlog

4 years ago

Metadata Update from @rcritten:
- Issue assigned to rcritten (was: someone)
- Issue close_status updated to: None
- Issue set to the milestone: None (was: FreeIPA 4.5 backlog)

8 months ago

master:

  • 4a89da5 ipatests: Add option/arg parsing tests for the cli
  • 12dfb0f cli: When parsing options require name/value pairs

ipa-4-8:

  • 6f4f7c6 ipatests: Add option/arg parsing tests for the cli
  • dce5b1c cli: When parsing options require name/value pairs

Metadata Update from @rcritten:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

8 months ago

Login to comment on this ticket.

Metadata