diff options
Diffstat (limited to 'framework/src/main/java')
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); |