Bug 1125176 - pulp-admin does not handle exception while accessing non-existent config file
Summary: pulp-admin does not handle exception while accessing non-existent config file
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: 2.4 Beta
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
: ---
Assignee: pulp-bugs
QA Contact: Irina Gulina
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-31 08:57 UTC by Irina Gulina
Modified: 2015-02-28 22:14 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-28 22:14:16 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Pulp Redmine 479 None None None Never

Description Irina Gulina 2014-07-31 08:57:17 UTC
Description of problem:
Traceback is returned while accessing non-existent config file  

Version-Release number of selected component (if applicable):
>>rpm -qa | grep pulp-admin
pulp-admin-client-2.4.0-0.29.beta.fc20.noarch

How reproducible:
always


Steps to Reproduce:
>> pulp-admin --config --help
Traceback (most recent call last):
  File "/usr/bin/pulp-admin", line 9, in <module>
    load_entry_point('pulp-client-admin==2.4.0', 'console_scripts', 'pulp-admin')()
  File "/usr/lib/python2.7/site-packages/pulp/client/admin/__init__.py", line 35, in main
    config_files, exception_handler_class=AdminExceptionHandler
  File "/usr/lib/python2.7/site-packages/pulp/client/launcher.py", line 66, in main
    config = _load_configuration(config_filenames)
  File "/usr/lib/python2.7/site-packages/pulp/client/launcher.py", line 123, in _load_configuration
    config = Config(*filenames)
  File "/usr/lib/python2.7/site-packages/pulp/common/config.py", line 199, in __init__
    self.open(input, filter)
  File "/usr/lib/python2.7/site-packages/pulp/common/config.py", line 223, in open
    fp = open(path)
IOError: [Errno 2] No such file or directory: '--help'

>>pulp-admin --config no_such_file
Traceback (most recent call last):
  File "/usr/bin/pulp-admin", line 9, in <module>
    load_entry_point('pulp-client-admin==2.4.0', 'console_scripts', 'pulp-admin')()
  File "/usr/lib/python2.7/site-packages/pulp/client/admin/__init__.py", line 35, in main
    config_files, exception_handler_class=AdminExceptionHandler
  File "/usr/lib/python2.7/site-packages/pulp/client/launcher.py", line 66, in main
    config = _load_configuration(config_filenames)
  File "/usr/lib/python2.7/site-packages/pulp/client/launcher.py", line 123, in _load_configuration
    config = Config(*filenames)
  File "/usr/lib/python2.7/site-packages/pulp/common/config.py", line 199, in __init__
    self.open(input, filter)
  File "/usr/lib/python2.7/site-packages/pulp/common/config.py", line 223, in open
    fp = open(path)
IOError: [Errno 2] No such file or directory: 'no_such_file'

>>pulp-admin --config=no_such_file
Traceback (most recent call last):
  File "/usr/bin/pulp-admin", line 9, in <module>
    load_entry_point('pulp-client-admin==2.4.0', 'console_scripts', 'pulp-admin')()
  File "/usr/lib/python2.7/site-packages/pulp/client/admin/__init__.py", line 35, in main
    config_files, exception_handler_class=AdminExceptionHandler
  File "/usr/lib/python2.7/site-packages/pulp/client/launcher.py", line 66, in main
    config = _load_configuration(config_filenames)
  File "/usr/lib/python2.7/site-packages/pulp/client/launcher.py", line 123, in _load_configuration
    config = Config(*filenames)
  File "/usr/lib/python2.7/site-packages/pulp/common/config.py", line 199, in __init__
    self.open(input, filter)
  File "/usr/lib/python2.7/site-packages/pulp/common/config.py", line 223, in open
    fp = open(path)
IOError: [Errno 2] No such file or directory: 'no_such_file'

>>pulp-admin --config=no_such_file --help
Usage: pulp-admin [options]

Options:
  -h, --help            show this help message and exit
  -u USERNAME, --username=USERNAME
                        credentials for the Pulp server; if specified will
                        bypass the stored certificate
  -p PASSWORD, --password=PASSWORD
                        credentials for the Pulp server; must be specified
                        with --username
  --debug               enables debug logging
  --config=CONFIG       absolute path to the configuration file
  --map                 prints a map of the CLI sections and commands



Expected results:
No such file or directory: 'no_such_file' + Error code [ `echo $?` -gt  0 ]

Comment 1 Brian Bouterse 2015-02-28 22:14:16 UTC
Moved to https://pulp.plan.io/issues/479


Note You need to log in before you can comment on or make changes to this bug.