Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-5568

Karaf Commands cannot have return codes

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.4
    • Fix Version/s: 4.2.0, 4.1.5
    • Component/s: karaf
    • Labels:
      None

      Description

      I've been trying to implement proper return codes for my custom karaf commands (so they can be evaluated when called via SSH) but it seems return codes are currently not handled correctly.

       

      If an 'Action' returns an Integer, that integer is currently printed out on stdout in the local shell and ignored in an SSH shell.

      I would like to submit a pull request that introduces the following changes:

      • for SSH (ShellCommand) use the result as exitStatus if it is an integer
      • for local shell (ConsoleSessionImpl) only print out the result it is an instance of string

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jbonofre Jean-Baptiste Onofré
                Reporter:
                j.utzig Johannes Utzig
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: