Bug 1266968 - hammer auth status returns exit code 0 even when login failed
hammer auth status returns exit code 0 even when login failed
Status: CLOSED WONTFIX
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hammer (Show other bugs)
6.1.2
x86_64 Linux
unspecified Severity low (vote)
: Unspecified
: --
Assigned To: Martin Bacovsky
Katello QA List
http://projects.theforeman.org/issues...
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-28 13:02 EDT by Reartes Guillermo
Modified: 2017-01-05 10:10 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-01-05 10:10:13 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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 13858 None None None 2016-04-22 11:34 EDT

  None (edit)
Description Reartes Guillermo 2015-09-28 13:02:22 EDT
Description of problem:

In this example i do not specify neither an username nor a password:

[root@sixthsat2 ~]# hammer os list
[Foreman] Username: 
[Foreman] Password for : 
Nombre o password inválidos
[root@sixthsat2 ~]# echo $?
129

Similar to the above example:

# hammer --username fakeuser --password wrongpassword os list
Nombre o password inválidos
[root@sixthsat2 ~]# echo $?
129


But this is (imho) wrong:

[root@sixthsat2 ~]# hammer --username fakeuser --password wrongpassword auth status
Está identificado como 'fakeuser'
[root@sixthsat2 ~]# echo $?
0

There is no fakeuser user and the password is also wrong.
A proper non-zero exit conde should be returned, at least i do think so.

Does hammer first authenticate and then execute the 'auth status' or is different for some reason?



Version-Release number of selected component (if applicable):
Satellite 6.1.2
rubygem-hammer_cli-0.1.4.12-1.el7sat.noarch

How reproducible:
always

Steps to Reproduce:
[root@sixthsat2 ~]# hammer --username fakeuser --password wrongpassword auth status
Está identificado como 'fakeuser'
[root@sixthsat2 ~]# echo $?
0

Actual results:
exit code 0 returned

Expected results:
exit code 129 (or other, the most appropiate one) instead.

Additional info:
I was writing a simple script, i choose 'auth status' as the simplest command to call to test, since it does just the login part, before doing other stuff to the satellite. But since it always return 0, it is not usefull.
Comment 2 Bryan Kearney 2016-02-23 12:18:01 EST
Created redmine issue http://projects.theforeman.org/issues/13858 from this bug
Comment 3 Bryan Kearney 2017-01-05 10:10:13 EST
This is an older bug which has been reported upstream. We are not going to track this bug downstream. When the upstream issue is resolved, the next build will contain the fix. Thank you.

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