diff options
author | 2017-09-29 15:52:59 +0530 | |
---|---|---|
committer | 2017-09-29 15:54:27 +0530 | |
commit | 789552ac35830642855c6a5d6c16afa3c4eed109 (patch) | |
tree | 8a2bdaa740c126dc280574447c71766e0598b1df /framework/src/main/java/org/onap | |
parent | eeed87109a19fdf834fc77f8926f094ce29e6467 (diff) |
Remove CLI_DEV and replace by discover_always conf
CLI-2
Change-Id: Ic67ac30c6f6c9a0a8928b1fac6d5adc85ca53a5b
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'framework/src/main/java/org/onap')
4 files changed, 15 insertions, 12 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 2a16cb79..72e22b51 100644 --- a/framework/src/main/java/org/onap/cli/fw/OnapCommandRegistrar.java +++ b/framework/src/main/java/org/onap/cli/fw/OnapCommandRegistrar.java @@ -58,8 +58,6 @@ public class OnapCommandRegistrar { private boolean isInteractiveMode = false; - private boolean isDevMode = Boolean.parseBoolean(System.getenv(Constants.CLI_DEV_MODE)); - private OnapCommandParameterCache paramCache = OnapCommandParameterCache.getInstance(); public boolean isInteractiveMode() { @@ -82,14 +80,6 @@ public class OnapCommandRegistrar { paramCache.remove(this.getEnabledProductVersion(), paramName); } - public boolean isDevMode() { - return isDevMode; - } - - public void setDevMode(boolean isDevMode) { - this.isDevMode = isDevMode; - } - public void setProfile(String profileName) { this.paramCache.setProfile(profileName); } 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 17b771c0..e9e52baa 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 @@ -196,7 +196,7 @@ public class Constants { public static final String PARAM_CACHE_FILE_NAME = "global-profile"; - public static final String CLI_DEV_MODE = "CLI_DEV"; + public static final String DISCOVER_ALWAYS = "discover_always"; private Constants() { } diff --git a/framework/src/main/java/org/onap/cli/fw/conf/OnapCommandConfg.java b/framework/src/main/java/org/onap/cli/fw/conf/OnapCommandConfg.java index b706ea66..249ec0e0 100644 --- a/framework/src/main/java/org/onap/cli/fw/conf/OnapCommandConfg.java +++ b/framework/src/main/java/org/onap/cli/fw/conf/OnapCommandConfg.java @@ -62,6 +62,19 @@ public final class OnapCommandConfg { return false; } + /** + * is discovery should do every time. + * + * @return boolean + */ + public static boolean isDiscoverAlways() { + if ("true".equals(prps.getProperty(Constants.DISCOVER_ALWAYS))) { + return true; + } + + return false; + } + public static String getVersion() { return prps.getProperty(Constants.ONAP_CLI_VERSION); } 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 939c753a..77d50171 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 @@ -1682,7 +1682,7 @@ public class OnapCommandUtils { */ public static List<ExternalSchema> loadExternalSchemasFromJson() throws OnapCommandException { List<ExternalSchema> schemas = new ArrayList<>(); - if (OnapCommandRegistrar.getRegistrar().isDevMode() || !isJsonFileDiscovered()) { + if (OnapCommandConfg.isDiscoverAlways() || !isJsonFileDiscovered()) { schemas = findAllExternalSchemas(); if (!schemas.isEmpty()) { persist(schemas); |