aboutsummaryrefslogtreecommitdiffstats
path: root/adapters
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2018-02-07 09:52:50 +0000
committerGerrit Code Review <gerrit@onap.org>2018-02-07 09:52:50 +0000
commitb5df7eca046a31b96b21413b4d83f472f4a08088 (patch)
tree3b1e7059ea13876b4782da8dceaeebda0a6ef5d1 /adapters
parent4947f32fccc36ee084d670d2a91fa0a2b77dce33 (diff)
parent1fd5182d39dd63c30775b2dbf4910cd827cd6231 (diff)
Merge "Get Msb Ip from env parameter"
Diffstat (limited to 'adapters')
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java23
1 files changed, 15 insertions, 8 deletions
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java
index 7690d80609..afee1bbfaa 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java
@@ -63,20 +63,27 @@ public class RestfulUtil {
private static final MsoAlarmLogger ALARMLOGGER = new MsoAlarmLogger();
private static final int DEFAULT_TIME_OUT = 60000;
+
+ private static final String ONAP_IP = "ONAP_IP";
+
+ private static final String DEFAULT_MSB_IP = "127.0.0.1";
+
+ private static final String DEFAULT_MSB_PORT = "80";
private static final MsoPropertiesFactory msoPropertiesFactory = new MsoPropertiesFactory();
public static String getMsbHost() {
- String msbIp = "10.229.32.131";
- String msbPort = "8090";
+ String msbPort = DEFAULT_MSB_PORT;
+ // MSB_IP will be set as ONAP_IP environment parameter in install flow.
+ String msbIp = System.getenv().get(ONAP_IP);
try {
- msbIp = msoPropertiesFactory.getMsoJavaProperties("MSO_PROP_TOPOLOGY").getProperty("msb-ip",
- "10.229.32.131");
- msbPort = msoPropertiesFactory.getMsoJavaProperties("MSO_PROP_TOPOLOGY").getProperty("msb-port", "8099");
-
+ // if ONAP IP is not set. get it from config file.
+ if(null == msbIp || msbIp.isEmpty()) {
+ msbIp = msoPropertiesFactory.getMsoJavaProperties("MSO_PROP_TOPOLOGY").getProperty("msb-ip", DEFAULT_MSB_IP);
+ msbPort = msoPropertiesFactory.getMsoJavaProperties("MSO_PROP_TOPOLOGY").getProperty("msb-port", DEFAULT_MSB_PORT);
+ }
} catch(MsoPropertiesException e) {
- LOGGER.error(MessageEnum.RA_NS_EXC, "VFC Adapter", "", MsoLogger.ErrorCode.AvailabilityError,
- "Get msb properties failed");
+ LOGGER.error(MessageEnum.RA_NS_EXC, "VFC Adapter", "", MsoLogger.ErrorCode.AvailabilityError, "Get msb properties failed");
e.printStackTrace();
}
return "http://" + msbIp + ":" + msbPort;