Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-41022

[RFE] rhc exits with return codes

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • rhc
    • None
    • rhel-sst-csi-client-tools
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None

      Goal

      As a sysadmin, I use rhc in a bash script and act on return codes.  Currently, there are no return codes for checking status. It's always zero.

      rhc
      [root@satellite.site3.example.com ~]$ rhc status
      Connection status for satellite.site3.example.com:
      
      ● Connected to Red Hat Subscription Management
      ● Connected to Red Hat Insights
      ● The Remote Host Configuration daemon is inactive
      
      Manage your connected systems: https://red.ht/connector
      [root@satellite.site3.example.com ~]$ echo $?
      0
      [root@satellite.site3.example.com ~]$
      

      Compare that with what you get from systemctl.

      systemctl
      [root@satellite.site3.example.com ~]$ systemctl status rhcd
      ● rhcd.service - Remote Host Configuration daemon
         Loaded: loaded (/usr/lib/systemd/system/rhcd.service; disabled; vendor preset: disabled)
         Active: inactive (dead)
           Docs: https://github.com/redhatinsights/yggdrasil
      [root@satellite.site3.example.com ~]$ echo $?
      3
      [root@satellite.site3.example.com ~]$
      

       

      Acceptance Criteria

      rhc status returns codes to show what is and is not OK. For instance, maybe base codes on an octet like this.

      • rc 0 (000), all enabled
      • rc 1 (001), RHSM OK, insights OK, rhcd daemon dead
      • rc 2 (010), insights nope, others OK
      • ...
      • rc 7 (111), all dead

              csi-client-tools-bugs CSI Client Tools Bugs Bot
              nhardima1 Nicholas Hardiman
              CSI Client Tools Bugs Bot CSI Client Tools Bugs Bot
              CSI Client Tools Bugs Bot CSI Client Tools Bugs Bot
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: