summaryrefslogtreecommitdiffstats
path: root/holmes-actions
diff options
context:
space:
mode:
authortang peng <tang.peng5@zte.com.cn>2017-10-31 04:37:36 +0000
committerGerrit Code Review <gerrit@onap.org>2017-10-31 04:37:36 +0000
commitd30677e80b8756048f9633ecba4c26360e3f644c (patch)
tree754dbde741ddcb8fb9706f3a09a87fd3dcf08b9c /holmes-actions
parent8813646a1076600646630eba58940b7b7ba46c90 (diff)
parentb81ab90bdc2cd6aeebe9b07516a9cb513749d7cd (diff)
Merge "Update the logic for MSB addr Query"
Diffstat (limited to 'holmes-actions')
-rw-r--r--holmes-actions/src/main/java/org/onap/holmes/common/config/MicroServiceConfig.java11
-rw-r--r--holmes-actions/src/main/java/org/onap/holmes/common/dcae/DcaeConfigurationQuery.java2
2 files changed, 9 insertions, 4 deletions
diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/config/MicroServiceConfig.java b/holmes-actions/src/main/java/org/onap/holmes/common/config/MicroServiceConfig.java
index 212bc66..d86f56c 100644
--- a/holmes-actions/src/main/java/org/onap/holmes/common/config/MicroServiceConfig.java
+++ b/holmes-actions/src/main/java/org/onap/holmes/common/config/MicroServiceConfig.java
@@ -98,10 +98,15 @@ public class MicroServiceConfig {
//String info = getServiceAddrInfoFromCBS(MSB_ADDR);
String info = getServiceAddrInfoFromCBS(getEnv(HOSTNAME));
log.info("Got the service information of \"" + getEnv(HOSTNAME) + "\" from CBS. The response is " + info + ".");
- JSONObject infoObj = JSONObject.fromObject(info);
- info = infoObj.has("msb.hostname") ? infoObj.getString("msb.hostname") : null;
+
if (info != null){
- msbServerInfo = split(info);
+ JSONObject infoObj = JSONObject.fromObject(info);
+ String msbInfoTmp = infoObj.has("msb.hostname") ? infoObj.getString("msb.hostname") : null;
+ if (msbInfoTmp != null) {
+ msbServerInfo = split(msbInfoTmp);
+ } else {
+ msbServerInfo = split(getEnv(MSB_ADDR));
+ }
} else {
msbServerInfo = split(getEnv(MSB_ADDR));
}
diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/dcae/DcaeConfigurationQuery.java b/holmes-actions/src/main/java/org/onap/holmes/common/dcae/DcaeConfigurationQuery.java
index 8dd3690..897f689 100644
--- a/holmes-actions/src/main/java/org/onap/holmes/common/dcae/DcaeConfigurationQuery.java
+++ b/holmes-actions/src/main/java/org/onap/holmes/common/dcae/DcaeConfigurationQuery.java
@@ -34,7 +34,7 @@ public class DcaeConfigurationQuery {
try {
response = getDcaeResponse(serviceAddrInfo);
} catch (Exception e) {
- throw new CorrelationException("Failed to connect to dcae", e);
+ throw new CorrelationException("Failed to connect to DCAE. ", e);
}
DcaeConfigurations dcaeConfigurations = null;
dcaeConfigurations = DcaeConfigurationParser.parse(response);