[katello-devel] Q - should cmd line katello give non-zero exit status for this?

Cliff Perry cperry at redhat.com
Tue Nov 1 15:54:34 UTC 2011


[root at dhcp77-176 ~]# katello --username admin --password admin ping
-------------------------------------------------------------------------------------------------------------------------------------------
                                                              Katello Status

 Status   Service          Result   Duration   Message
-------------------------------------------------------------------------------------------------------------------------------------------
 ok
          candlepin        ok       45ms
          pulp_auth        ok       102ms
          pulp             ok       72ms
          candlepin_auth   ok       44ms
[root at dhcp77-176 ~]# echo $?
0
[root at dhcp77-176 ~]# service tomcat6 stop
Stopping tomcat6:                                          [  OK  ]
[root at dhcp77-176 ~]# katello --username admin --password admin ping
-------------------------------------------------------------------------------------------------------------------------------------------
                                                              Katello Status

 Status   Service          Result   Duration   Message

-------------------------------------------------------------------------------------------------------------------------------------------
 fail

          candlepin        fail                Connection refused -
connect(2)
          pulp_auth        ok       60ms

          pulp             ok       51ms

          candlepin_auth   fail                Connection refused -
connect(2)
[root at dhcp77-176 ~]# echo $?
0
[root at dhcp77-176 ~]#

So the command ran fine, but it reported failures within the services it
is reporting.

*IF* it returned non-zero we could automate easier a check at the end of
installation - without looking at the strings.

So, should the command exit 0 for success, or 1 for failure in this use
case? :)

Cliff




More information about the katello-devel mailing list