Bug 1480087 - In ceph-medic, few commands are not performing with both valid and invalid values ,as expected.
In ceph-medic, few commands are not performing with both valid and invalid va...
Status: CLOSED WORKSFORME
Product: Red Hat Ceph Storage
Classification: Red Hat
Component: Ceph-Medic (Show other bugs)
3.0
Unspecified Linux
low Severity low
: rc
: 3.1
Assigned To: Andrew Schoen
Andrew Schoen
Andrew Schoen
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-10 02:34 EDT by Shreekar
Modified: 2018-01-09 02:26 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-01-09 02:26:12 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Shreekar 2017-08-10 02:34:28 EDT
Description of problem:
CLI Validation:
While performing validations against ceph-medic, few commands did not run as expected and thrown errors which were not user friendly.

Version-Release number of selected component (if applicable):
ceph-medic 1.0.0

How reproducible: 
Always

Steps to Reproduce:
1) "ceph-medic --inventory <invalid path> --ssh-config <invalid path> check " ,this command is returning exception error, suppose to return proper error message
2)"ceph-medic --inventory /path/to/hosts --ssh-config <invalid path>&<valid path> check", for both checks, it is showing same error(Collection failed!                                                                      
--> RuntimeError: All nodes failed to connect. Cannot run any checks). Suppose to get proper message.
3) "ceph-medic --inventory /path/to/hosts --ssh-config /path/to/ssh_config", If it's run without "check", not returning any error messages.Should display error message.
4)"ceph-medic --invendffdtory /path/to/hosts --ssh-confffig /path/to/ssh_config checck", for misspelled options, should return more proper message.

Actual results:
Incorrect error messages

Expected results:
User friendly error messages
Comment 2 Alfredo Deza 2017-08-10 11:37:25 EDT
Please include a copy of all tracebacks found for this issue.

Also, please create separate BZs for each of the issues found, otherwise it is hard to track and correlate fixes to BZs
Comment 3 Ian Colle 2017-08-15 13:32:46 EDT
Shreekar, can you please see Alfredo's request above and split this into separate bz's with tracebacks included as appropriate?
Comment 4 Shreekar 2017-08-28 07:21:37 EDT
Hi, sorry for late response. Here are the tracebacks.
"ceph-medic --inventory <invalid path> --ssh-config <valid path> check "
Traceback (most recent call last):
  File "/usr/bin/ceph-medic", line 6, in <module>
    main.Medic()
  File "/usr/lib/python2.7/dist-packages/ceph_medic/main.py", line 44, in __init__
    self.main(argv)
  File "/usr/lib/python2.7/dist-packages/ceph_medic/decorators.py", line 45, in newfunc
    return f(*a, **kw)
  File "/usr/lib/python2.7/dist-packages/ceph_medic/main.py", line 120, in main
    ceph_medic.config.get('--inventory', self.hosts_file)))
  File "/usr/lib/python2.7/dist-packages/ceph_medic/util/configuration.py", line 106, in load_hosts
    return AnsibleInventoryParser(_path)
  File "/usr/lib/python2.7/dist-packages/ceph_medic/util/configuration.py", line 280, in __init__
    with open(filename, 'r') as fh:
IOError: [Errno 2] No such file or directory: '/etc/ansible/hostss'
Comment 5 Shreekar 2017-08-28 07:22:46 EDT
"ceph-medic --inventory /path/to/hosts --ssh-config <invalid path>&<valid path> check"==
Can't open user config file /root/.cephmeddic.conf: No such file or directory
Host: magna118.ceph.redhat.com  connection: [failed     ]                       
Can't open user config file /root/.cephmeddic.conf: No such file or directory
Host: magna118.ceph.redhat.com  connection: [failed     ]                      
Can't open user config file /root/.cephmeddic.conf: No such file or directory
Host: magna101.ceph.redhat.com  connection: [failed     ]                      
Can't open user config file /root/.cephmeddic.conf: No such file or directory
Host: magna102.ceph.redhat.com  connection: [failed     ]                      
Can't open user config file /root/.cephmeddic.conf: No such file or directory
Host: magna114.ceph.redhat.com  connection: [failed     ]                      
Can't open user config file /root/.cephmeddic.conf: No such file or directory
Host: magna004.ceph.redhat.com  connection: [failed     ]                      
Can't open user config file /root/.cephmeddic.conf: No such file or directory
Host: magna118.ceph.redhat.com  connection: [failed     ]                      
Collection failed!                                                                      
--> RuntimeError: All nodes failed to connect. Cannot run any checks
Comment 6 Shreekar 2017-08-28 07:23:23 EDT
"ceph-medic --invendffdtory /path/to/hosts --ssh-confffig /path/to/ssh_config checck", for misspelled options 
Unknown command(s):
Comment 7 Alfredo Deza 2017-08-28 07:35:48 EDT
Shreekar, thank you for the added information. To better track the changes needed to address these, please open separate BZs against the problems found. 

Do link them back to this ticket so we can find them when you do.

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