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

CLI subcommands do not return exit code to shell

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: SERVER 5.0.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Team:
      Systems Engineering
    • Sub-team:
    • Story Points:
      1
    • Sprint:
      Server 2017-04-05
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      The puppetserver CLI subcommands now exit with the same return code as the underlying ruby command would have used. Previously the exit codes were discarded, which could swallow errors from commands like `puppetserver gem`.
    • QA Risk Assessment:
      Needs Assessment

      Description

      When any of the CLI subcommands are run, the exit code generated from the call to .run on the org.jruby.Main instance is not propagated all the way back out to the shell. This causes commands which fail to errantly always return a 0 (success) exit code, for example:

      > puppetserver gem install nananana
      Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
      ERROR:  Could not find a valid gem 'nananana' (>= 0) in any repository
      > echo $?
      0
      

      If run via MRI Ruby, the exit code would be "2" instead of "0" for this case.

      This issue affects all of the CLI subcommands - irb, gem, and ruby.

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  adrien Adrien Thebo
                  Reporter:
                  jeremy.barlow Jeremy Barlow
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: