aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-10-26 19:36:45 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-10-26 19:56:43 +0530
commitef7de3edf23a0c6fba6e6fb3e175798adc532d78 (patch)
tree56ec5aae3b083acc147c9137ab2733caddef6bc8 /main
parentb0d8aa12fe8f88059f7fcce741913194d72d0d69 (diff)
Fix the sample file name align with schema
CLI-55 Change-Id: I84533921d6a2bbfd818e0c68b723d6f131a21b2c Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'main')
-rw-r--r--main/src/main/java/org/onap/cli/main/OnapCli.java10
1 files changed, 5 insertions, 5 deletions
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 0ed27ea1..4cc2132d 100644
--- a/main/src/main/java/org/onap/cli/main/OnapCli.java
+++ b/main/src/main/java/org/onap/cli/main/OnapCli.java
@@ -363,7 +363,7 @@ public class OnapCli {
this.print(result.print());
this.exitSuccessfully();
- generateSmapleYaml(result);
+ generateSmapleYaml(cmd);
} catch (Exception e) {
this.print(cmd.getResult().getDebugInfo());
if (e instanceof OnapCommandWarning) {
@@ -376,13 +376,13 @@ public class OnapCli {
}
}
- private void generateSmapleYaml(OnapCommandResult result) throws OnapCommandException {
+ private void generateSmapleYaml(OnapCommand cmd) throws OnapCommandException {
if (OnapCommandConfg.isSampleGenerateEnabled() && this.getExitCode() == OnapCliConstants.EXIT_SUCCESS) {
try {
- SampleYamlGenerator.generateSampleYaml(args, result.print(),
+ SampleYamlGenerator.generateSampleYaml(args, cmd.getResult().print(),
OnapCommandRegistrar.getRegistrar().getEnabledProductVersion(),
- OnapCommandConfg.getSampleGenerateTargetFolder(),
- result.isDebug());
+ OnapCommandConfg.getSampleGenerateTargetFolder() + "/" + cmd.getSchemaName().replaceAll(".yaml", "") + "-sample.yaml",
+ cmd.getResult().isDebug());
} catch (IOException error) {
throw new OnapCommandInvalidSample(args.get(0), error);
}