summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuangrong Fu <fu.guangrong@zte.com.cn>2017-10-31 12:20:33 +0800
committerGuangrong Fu <fu.guangrong@zte.com.cn>2017-10-31 12:20:33 +0800
commitb81ab90bdc2cd6aeebe9b07516a9cb513749d7cd (patch)
tree625401cc16cd8a4182ad44b3b30203abbb40572b
parent3dfe506a8ea1bec7096da63541e426958d04a1a0 (diff)
Update the logic for MSB addr Query
Change-Id: I2e7bcd48e04b7ec54573d3eb2dbb9b525e25c3b6 Issue-ID: HOLMES-81 Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn>
-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);