summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-02-12 13:28:06 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-02-12 13:34:10 +0530
commit7ed67d67439e5945302bbab030a9627193de6616 (patch)
treed4098b4fe037fd266d74e6e039d18deda2b5ed91
parent3984f88cab86fb89c0b5a6200730855eade5360e (diff)
Handle CLI warning effectivelyv2.0.0
Issue-ID: CLI-92 Change-Id: If5ce9499763fdec5980c4cdd1839d5ef31ccdd49 Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
-rw-r--r--framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java4
-rw-r--r--main/src/main/java/org/onap/cli/main/OnapCli.java11
2 files changed, 7 insertions, 8 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java b/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java
index bd910748..c5ebbc21 100644
--- a/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java
+++ b/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java
@@ -288,8 +288,8 @@ public class OnapCommandUtils {
for (String value: entry.getValue()) {
try {
value = replaceLineFromInputParameters(value, params);
- } catch(OnapCommandResultEmpty e) {
- // pass // NOSONAR
+ } catch(OnapCommandResultEmpty e) { // NOSONAR
+ // pass
}
resultsProcessed.get(key).add(value);
}
diff --git a/main/src/main/java/org/onap/cli/main/OnapCli.java b/main/src/main/java/org/onap/cli/main/OnapCli.java
index 62b78fd5..b8af6f51 100644
--- a/main/src/main/java/org/onap/cli/main/OnapCli.java
+++ b/main/src/main/java/org/onap/cli/main/OnapCli.java
@@ -376,14 +376,13 @@ public class OnapCli {
this.exitSuccessfully();
generateSmapleYaml(cmd);
+ } catch (OnapCommandWarning w) {
+ this.print(cmd.getResult().getDebugInfo());
+ this.exitSuccessfully();
} catch (Exception e) {
+ this.print(e);
this.print(cmd.getResult().getDebugInfo());
- if (e instanceof OnapCommandWarning) {
- this.exitSuccessfully();
- } else {
- this.print(e);
- this.exitFailure();
- }
+ this.exitFailure();
}
}
}