diff options
author | Kanagaraj Manickam <kanagaraj.manickam@huawei.com> | 2017-09-11 03:53:57 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-11 03:53:57 +0000 |
commit | df53002120bca73d475c38862586296db3526444 (patch) | |
tree | 8bc2ac75e46154e7c2f4648d5d22530bdb795112 /framework/src/main | |
parent | aed32c570a103c70456371179a410e45d2f42bf3 (diff) | |
parent | 7293d08fcfecc5c66310303a8351f9efd219247e (diff) |
Merge changes Ic267f3f4,I1347393e
* changes:
Add CLI_DEV
Base docker image to openjdk:8-jre-slim
Diffstat (limited to 'framework/src/main')
3 files changed, 17 insertions, 1 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/OnapCommandRegistrar.java b/framework/src/main/java/org/onap/cli/fw/OnapCommandRegistrar.java index 019eb824..01d4742e 100644 --- a/framework/src/main/java/org/onap/cli/fw/OnapCommandRegistrar.java +++ b/framework/src/main/java/org/onap/cli/fw/OnapCommandRegistrar.java @@ -58,6 +58,8 @@ public class OnapCommandRegistrar { private boolean isInteractiveMode = false; + private boolean isDevMode = Boolean.getBoolean(System.getenv(Constants.CLI_DEV_MODE)); + private OnapCommandParameterCache paramCache = new OnapCommandParameterCache(); public boolean isInteractiveMode() { @@ -80,6 +82,15 @@ public class OnapCommandRegistrar { paramCache.remove(this.getEnabledProductVersion(), paramName); } + public boolean isDevMode() { + return isDevMode; + } + + public void setDevMode(boolean isDevMode) { + this.isDevMode = isDevMode; + } + + private static OnapCommandRegistrar registrar = null; /** diff --git a/framework/src/main/java/org/onap/cli/fw/conf/Constants.java b/framework/src/main/java/org/onap/cli/fw/conf/Constants.java index 23dfbbbe..d7e277c7 100644 --- a/framework/src/main/java/org/onap/cli/fw/conf/Constants.java +++ b/framework/src/main/java/org/onap/cli/fw/conf/Constants.java @@ -195,8 +195,12 @@ public class Constants { public static final String USE_DIRECTIVE = "use"; public static final String PARAM_CACHE_FILE_NAME = "cli.parameter.cache.file"; + + public static final String CLI_DEV_MODE = "CLI_DEV"; + private Constants() { } } + 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 b31b75cf..ec735cfb 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 @@ -21,6 +21,7 @@ import com.jayway.jsonpath.JsonPath; import net.minidev.json.JSONArray; import net.minidev.json.JSONObject; import org.onap.cli.fw.OnapCommand; +import org.onap.cli.fw.OnapCommandRegistrar; import org.onap.cli.fw.ad.OnapCredentials; import org.onap.cli.fw.ad.OnapService; import org.onap.cli.fw.cmd.OnapHttpCommand; @@ -1654,7 +1655,7 @@ public class OnapCommandUtils { */ public static List<ExternalSchema> loadExternalSchemasFromJson() throws OnapCommandException { List<ExternalSchema> schemas = new ArrayList<>(); - if (!isJsonFileDiscovered()) { + if (OnapCommandRegistrar.getRegistrar().isDevMode() || !isJsonFileDiscovered()) { schemas = findAllExternalSchemas(); if (!schemas.isEmpty()) { persist(schemas); |