Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1054362

Summary: [RFE] Ping command sbould return status based on backend services being up or down
Product: Red Hat Satellite Reporter: Bryan Kearney <bkearney>
Component: HammerAssignee: Adam Price <adprice>
Status: CLOSED CURRENTRELEASE QA Contact: sthirugn <sthirugn>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.3CC: erezende, sthirugn
Target Milestone: UnspecifiedKeywords: FutureFeature, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-11 12:21:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bryan Kearney 2014-01-16 17:08:18 UTC
The ping command should return non zero based on what system is down. See the code from the old katello-cli

    def __returnCode(self, status):
        """
        Creates a return code according to returned statuses.
        Error codes (combination by bitwise or):
            candlepin:      2
            candlepin_auth: 4
            pulp:           8
            pulp_auth:     16
        """
        if status['result'].lower() == 'ok':
            return 0

        code = 0
        # pylint: disable=W0612
        for serviceName, serviceStatus in self.__sortedStatuses(status, reverse=True):
            if serviceStatus['result'] != 'ok':
                code += 1
            code = code << 1
        return code

Comment 5 Elyézer Rezende 2014-05-05 17:41:04 UTC
Could not test hammer ping as the nightly installer is failing

# katello-installer -v -d
tput: No value for $TERM and no -T specified
[[32m INFO[0m [34m2014-05-05 12:52:27[0m [36mverbose[0m] Running validation checks
[[31mERROR[0m [34m2014-05-05 12:52:28[0m [36mverbose[0m] "foreman::plugin::discovery::params::install_images" is not a boolean.  It looks to be a String
[[31mERROR[0m [34m2014-05-05 12:52:28[0m [36mverbose[0m] Parameter foreman-plugin-discovery-install-images invalid
Error during configuration, exiting

# hammer ping
Could not load API description from the server
  - is your server down?
  - was "foreman-rake apipie:cache" run on the server when using apipie cache? (typical production settings))
Could not load API description from the server
  - is your server down?
  - was "foreman-rake apipie:cache" run on the server when using apipie cache? (typical production settings))
Error: No such sub-command 'ping'

See: 'hammer --help'
Warning: An error occured while loading module hammer_cli_foreman
Warning: An error occured while loading module hammer_cli_katello

PS.: I'm using katello-deploy script

Comment 7 sthirugn@redhat.com 2014-09-03 14:26:00 UTC
Verified.

# hammer -u admin -p changeme ping
candlepin:      
    Status:          ok
    Server Response: Duration: 30ms
candlepin_auth: 
    Status:          ok
    Server Response: Duration: 32ms
pulp:           
    Status:          ok
    Server Response: Duration: 19ms
pulp_auth:      
    Status:          ok
    Server Response: Duration: 24ms
elasticsearch:  
    Status:          ok
    Server Response: Duration: 31ms
foreman_tasks:  
    Status:          ok
    Server Response: Duration: 0ms

# echo $?
0


Version Tested:
GA Snap 7 - Satellite-6.0.4-RHEL-6-20140829.0

* apr-util-ldap-1.3.9-3.el6_0.1.x86_64
* candlepin-0.9.23-1.el6_5.noarch
* candlepin-common-1.0.1-1.el6_5.noarch
* candlepin-scl-1-5.el6_4.noarch
* candlepin-scl-quartz-2.1.5-5.el6_4.noarch
* candlepin-scl-rhino-1.7R3-1.el6_4.noarch
* candlepin-scl-runtime-1-5.el6_4.noarch
* candlepin-selinux-0.9.23-1.el6_5.noarch
* candlepin-tomcat6-0.9.23-1.el6_5.noarch
* elasticsearch-0.90.10-6.el6sat.noarch
* foreman-1.6.0.42-1.el6sat.noarch
* foreman-compute-1.6.0.42-1.el6sat.noarch
* foreman-gce-1.6.0.42-1.el6sat.noarch
* foreman-libvirt-1.6.0.42-1.el6sat.noarch
* foreman-ovirt-1.6.0.42-1.el6sat.noarch
* foreman-postgresql-1.6.0.42-1.el6sat.noarch
* foreman-proxy-1.6.0.30-1.el6sat.noarch
* foreman-selinux-1.6.0.14-1.el6sat.noarch
* foreman-vmware-1.6.0.42-1.el6sat.noarch
* katello-1.5.0-30.el6sat.noarch
* katello-ca-1.0-1.noarch
* katello-certs-tools-1.5.6-1.el6sat.noarch
* katello-installer-0.0.62-1.el6sat.noarch
* openldap-2.4.23-34.el6_5.1.x86_64
* openldap-devel-2.4.23-34.el6_5.1.x86_64
* pulp-katello-0.3-4.el6sat.noarch
* pulp-nodes-common-2.4.1-0.5.rc1.el6sat.noarch
* pulp-nodes-parent-2.4.1-0.5.rc1.el6sat.noarch
* pulp-puppet-plugins-2.4.1-0.5.rc1.el6sat.noarch
* pulp-puppet-tools-2.4.1-0.5.rc1.el6sat.noarch
* pulp-rpm-plugins-2.4.1-0.5.rc1.el6sat.noarch
* pulp-selinux-2.4.1-0.5.rc1.el6sat.noarch
* pulp-server-2.4.1-0.5.rc1.el6sat.noarch
* python-ldap-2.3.10-1.el6.x86_64
* ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch
* ruby193-rubygem-runcible-1.1.0-2.el6sat.noarch

Comment 8 Bryan Kearney 2014-09-11 12:21:41 UTC
This was delivered with Satellite 6.0 which was released on 10 September 2014.