aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-vfc-adapter
diff options
context:
space:
mode:
Diffstat (limited to 'adapters/mso-vfc-adapter')
-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;