summaryrefslogtreecommitdiffstats
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/WebContent/WEB-INF/web.xml2
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsParameters.java2
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java23
3 files changed, 17 insertions, 10 deletions
diff --git a/adapters/mso-vfc-adapter/WebContent/WEB-INF/web.xml b/adapters/mso-vfc-adapter/WebContent/WEB-INF/web.xml
index cd97471b5b..66ea46fcc9 100644
--- a/adapters/mso-vfc-adapter/WebContent/WEB-INF/web.xml
+++ b/adapters/mso-vfc-adapter/WebContent/WEB-INF/web.xml
@@ -16,7 +16,7 @@
</context-param>
<context-param>
<param-name>mso.configuration</param-name>
- <param-value>MSO_PROP_NETWORK_ADAPTER=mso.vfc.properties,MSO_PROP_TOPOLOGY=topology.properties</param-value>
+ <param-value>MSO_PROP_VFC_ADAPTER=mso.vfc.properties,MSO_PROP_TOPOLOGY=topology.properties</param-value>
</context-param>
<context-param>
<param-name>mso.cloud_config.configuration</param-name>
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsParameters.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsParameters.java
index 2a5c305926..b4827d0f45 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsParameters.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsParameters.java
@@ -35,7 +35,7 @@ public class NsParameters {
private List<LocationConstraint> locationConstraints;
- private Map<String, Object> additionalParamForNs = new HashMap<String,Object>();
+ private Map<String, Object> additionalParamForNs = new HashMap<>();
/**
* @return Returns the locationConstraints.
*/
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;