Uploaded image for project: 'Puppet Server'
  1. Puppet Server
  2. SERVER-2797

Improve exit code for errors in 'puppetserver ca list'

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Accepted
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: SERVER 6.7.0
    • Fix Version/s: None
    • Component/s: Puppet Server
    • Labels:
      None
    • Environment:

      OSP puppetserver 6.7.1 with a CA master and 3 compile masters behind a loadbalancer.

    • Template:
    • Team:
      Froyo
    • QA Risk Assessment:
      Needs Assessment

      Description

      Use case: I'm working on some scripting to run a puppetserver ca command.  I want to put in a safeguard to prevent someone from running a CA command on a compile master.  The notion I had was to detect the ca-master by looking at the CA.

       

      A CA master runs puppetserver ca list --all just like you would expect.  On the compile masters, though:

       

      # puppetserver ca list --all
      Error:
       code: 403
       body: Forbidden request: /puppet-ca/v1/certificate_statuses/any_key (method :get). Please see the server logs for details.
      No certificates to list
       
      # echo $?
      0
      

       

      Since everything about that query was a failure, I would expect an error code to be returned.  Instead the error is all in the text.  While obvious to a human that this failed, with it having exited 0 we're into grepping text to find that the command failed.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            ratnix Greg
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support