summaryrefslogtreecommitdiffstats
path: root/framework
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-09-29 15:52:59 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-09-29 15:54:27 +0530
commit789552ac35830642855c6a5d6c16afa3c4eed109 (patch)
tree8a2bdaa740c126dc280574447c71766e0598b1df /framework
parenteeed87109a19fdf834fc77f8926f094ce29e6467 (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')
-rw-r--r--framework/src/main/java/org/onap/cli/fw/OnapCommandRegistrar.java10
-rw-r--r--framework/src/main/java/org/onap/cli/fw/conf/Constants.java2
-rw-r--r--framework/src/main/java/org/onap/cli/fw/conf/OnapCommandConfg.java13
-rw-r--r--framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java2
-rw-r--r--framework/src/main/resources/onap.properties2
-rw-r--r--framework/src/test/java/org/onap/cli/fw/OnapCommandRegistrarTest.java3
6 files changed, 16 insertions, 16 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);
diff --git a/framework/src/main/resources/onap.properties b/framework/src/main/resources/onap.properties
index 285e5c8a..77be05f3 100644
--- a/framework/src/main/resources/onap.properties
+++ b/framework/src/main/resources/onap.properties
@@ -1,7 +1,7 @@
cli.ignore_auth=false
cli.version=1.0
cli.http.api_key_use_cookies=true
-
+cli.discover_always=false
cli.service_name=onap-cli
cli.api_gateway=msb
cli.auth_service=auth
diff --git a/framework/src/test/java/org/onap/cli/fw/OnapCommandRegistrarTest.java b/framework/src/test/java/org/onap/cli/fw/OnapCommandRegistrarTest.java
index d123a875..c26678d7 100644
--- a/framework/src/test/java/org/onap/cli/fw/OnapCommandRegistrarTest.java
+++ b/framework/src/test/java/org/onap/cli/fw/OnapCommandRegistrarTest.java
@@ -147,9 +147,6 @@ public class OnapCommandRegistrarTest {
OnapCommandRegistrar.getRegistrar().getParamCache();
OnapCommandRegistrar.getRegistrar().removeParamCache("a");
- OnapCommandRegistrar.getRegistrar().setDevMode(true);
- OnapCommandRegistrar.getRegistrar().isDevMode();
-
OnapCommandRegistrar.getRegistrar().isInteractiveMode();
OnapCommandRegistrar.getRegistrar().setInteractiveMode(false);