Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-5986

cli.sh configimport returns success when errors occur

    Details

      Description

      I'm using cli.sh's configimport option inside a shell script. I'm testing for the return value for the script using code similar to this:

      #!/bin/bash
      cli.sh configimport --url https://localhost/openidm/ --port 8443 --replaceAll ./confdir || {
        echo $?
        exit 1
      }
      

      However, it seems that cli.sh returns 0 (ie success) regardless of whether it completed successfully.

      An example run of cli.sh configimport [...] gives the following output:

      Executing /opt/openidm/cli.sh...
      Starting shell in /opt/openidm
      No boot properties file detected at /opt/openidm/conf/boot/boot.properties
      ...................................................................
      [ConfigImport] Load JSON configuration files from:
      [ConfigImport] /tmp/tmp.gbYjhhevEs/conf
      SLF4J: Class path contains multiple SLF4J bindings.
      SLF4J: Found binding in [jar:file:/opt/openidm/bundle/custom-scripted-connector-bundler-4.0.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: Found binding in [jar:file:/opt/openidm/bundle/slf4j-jdk14-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
      SLF4J: Actual binding is of type [org.slf4j.impl.JDK14LoggerFactory]
      Operation failed: null

      This run has clearly been detected as failing, but the invocation of cli.sh still sets its exit value is still 0.

      It would be very useful if the exit value could be a non-zero value when errors have been detected.

        Attachments

          Activity

            People

            • Assignee:
              joy.feng Joy Feng [X] (Inactive)
              Reporter:
              max.spicer Max Spicer
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: