Project

General

Profile

Actions

Bug #13858

open

hammer auth status returns exit code 0 even when login failed

Added by Bryan Kearney about 8 years ago. Updated almost 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
Yes
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:
yes

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1266968
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:

  1. 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.

Actions #1

Updated by Shira Maximov over 4 years ago

  • Assignee deleted (Martin Bacovsky)
Actions #2

Updated by Shira Maximov over 4 years ago

  • In Kanboard set to yes

Changing the

Actions #3

Updated by Oleh Fedorenko about 4 years ago

  • Triaged changed from No to Yes
Actions #4

Updated by Adi Abramovitch almost 3 years ago

  • Assignee set to Adi Abramovitch
Actions #5

Updated by Adi Abramovitch almost 3 years ago

  • Assignee deleted (Adi Abramovitch)
Actions

Also available in: Atom PDF