aboutsummaryrefslogtreecommitdiffstats
path: root/adapters
diff options
context:
space:
mode:
Diffstat (limited to 'adapters')
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/AuthenticationMethodFactory.java2
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java85
-rw-r--r--adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsTest.java43
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.8.1__AddColumnAdminProjectDomainName.sql3
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java26
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java37
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java27
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/PollServiceTest.java16
8 files changed, 161 insertions, 78 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/AuthenticationMethodFactory.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/AuthenticationMethodFactory.java
index ab0239057a..c1c7ed5fd6 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/AuthenticationMethodFactory.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/AuthenticationMethodFactory.java
@@ -100,7 +100,7 @@ public final class AuthenticationMethodFactory {
Project project = new Project();
Project.Domain projectDomain = new Project.Domain();
userDomain.setName(cloudIdentity.getUserDomainName());
- projectDomain.setName(cloudIdentity.getProjectDomainName());
+ projectDomain.setName(cloudIdentity.getAdminProjectDomainName());
user.setName(cloudIdentity.getMsoId());
user.setPassword(CryptoUtils.decryptCloudConfigPassword(cloudIdentity.getMsoPass()));
user.setDomain(userDomain);
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java
index c4ef3678c3..ba4b30903d 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java
@@ -31,9 +31,10 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import static org.apache.commons.lang3.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
import org.onap.logging.filter.base.ErrorCode;
import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.adapters.vdu.CloudInfo;
@@ -49,6 +50,11 @@ import org.onap.so.adapters.vdu.VduStatus;
import org.onap.so.cloud.authentication.KeystoneAuthHolder;
import org.onap.so.db.catalog.beans.HeatTemplate;
import org.onap.so.db.catalog.beans.HeatTemplateParam;
+import org.onap.so.db.catalog.beans.NetworkResource;
+import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
+import org.onap.so.db.catalog.beans.VfModule;
+import org.onap.so.db.catalog.beans.VfModuleCustomization;
+import org.onap.so.db.catalog.client.CatalogDbClient;
import org.onap.so.db.request.beans.CloudApiRequests;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.client.RequestsDbClient;
@@ -108,6 +114,7 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
public static final String EXCEPTION_ROLLING_BACK_STACK =
"{} Create Stack: Nested exception rolling back stack: {} ";
public static final String IN_PROGRESS = "in_progress";
+ private static final int DEFAULT_POLLING_TIMEOUT = 118;
@Autowired
private Environment environment;
@@ -121,6 +128,9 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
@Autowired
RequestsDbClient requestDBClient;
+ @Autowired
+ private CatalogDbClient catalogClient;
+
private static final Logger logger = LoggerFactory.getLogger(MsoHeatUtils.class);
// Properties names and variables (with default values)
@@ -898,11 +908,6 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
if (inputs == null) {
return new HashMap<>();
}
- try {
- Set<HeatTemplateParam> paramSet = template.getParameters();
- } catch (Exception e) {
- logger.debug("Exception occurred in convertInputMap {} :", e.getMessage(), e);
- }
for (HeatTemplateParam htp : template.getParameters()) {
params.put(htp.getParamName(), htp);
@@ -1232,4 +1237,72 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
}
}
+ public int getVfHeatTimeoutValue(String modelCustomizationUuid, boolean isVolumeGroup) {
+ int timeoutMinutes = DEFAULT_POLLING_TIMEOUT;
+ try {
+ VfModuleCustomization vfmc = null;
+ if (modelCustomizationUuid != null) {
+ vfmc = catalogClient.getVfModuleCustomizationByModelCuztomizationUUID(modelCustomizationUuid);
+ if (vfmc != null) {
+ VfModule vf = vfmc.getVfModule();
+ if (vf != null) {
+ HeatTemplate heat = vf.getModuleHeatTemplate();
+ if (isVolumeGroup) {
+ heat = vf.getVolumeHeatTemplate();
+ }
+ if (heat != null && heat.getTimeoutMinutes() != null) {
+ if (heat.getTimeoutMinutes() < DEFAULT_POLLING_TIMEOUT) {
+ timeoutMinutes = heat.getTimeoutMinutes();
+ }
+ }
+ }
+ } else {
+ logger.debug(
+ "Unable to find Vf Module Customization with model customization uuid {}. Using default timeout {}",
+ modelCustomizationUuid, timeoutMinutes);
+ }
+ }
+ } catch (Exception e) {
+ logger.warn("Exception occured while getting heat timeout value. Using default timeout {}", timeoutMinutes,
+ e);
+ }
+ return timeoutMinutes;
+ }
+
+ public int getNetworkHeatTimeoutValue(String modelCustomizationUuid, String networkType) {
+ int timeoutMinutes = DEFAULT_POLLING_TIMEOUT;
+ try {
+ NetworkResource networkResource = null;
+ if (isBlank(modelCustomizationUuid)) {
+ if (isNotBlank(networkType)) {
+ networkResource = catalogClient.getNetworkResourceByModelName(networkType);
+ }
+ } else {
+ NetworkResourceCustomization nrc =
+ catalogClient.getNetworkResourceCustomizationByModelCustomizationUUID(modelCustomizationUuid);
+ if (nrc != null) {
+ networkResource = nrc.getNetworkResource();
+ }
+ }
+
+ if (networkResource != null) {
+ networkResource.getHeatTemplate().getTimeoutMinutes();
+ HeatTemplate heat = networkResource.getHeatTemplate();
+ if (heat != null && heat.getTimeoutMinutes() != null) {
+ if (heat.getTimeoutMinutes() < DEFAULT_POLLING_TIMEOUT) {
+ timeoutMinutes = heat.getTimeoutMinutes();
+ }
+ }
+ } else {
+ logger.debug(
+ "Unable to find Network Resource with model customization uuid {} or network type {}. Using default timeout {}",
+ modelCustomizationUuid, networkType, timeoutMinutes);
+ }
+ } catch (Exception e) {
+ logger.warn("Exception occured while getting heat timeout value. Using default timeout {}", timeoutMinutes,
+ e);
+ }
+ return timeoutMinutes;
+ }
+
}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsTest.java
index 5bd7c29313..f20f6f1448 100644
--- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsTest.java
+++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsTest.java
@@ -46,6 +46,12 @@ import org.mockito.Mockito;
import org.mockito.Spy;
import org.mockito.junit.MockitoJUnitRunner;
import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.onap.so.db.catalog.beans.HeatTemplate;
+import org.onap.so.db.catalog.beans.NetworkResource;
+import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
+import org.onap.so.db.catalog.beans.VfModule;
+import org.onap.so.db.catalog.beans.VfModuleCustomization;
+import org.onap.so.db.catalog.client.CatalogDbClient;
import org.onap.so.db.request.beans.CloudApiRequests;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.client.RequestsDbClient;
@@ -103,6 +109,9 @@ public class MsoHeatUtilsTest extends MsoHeatUtils {
@Mock
private CreateStack mockCreateStack;
+ @Mock
+ private CatalogDbClient catalogDbClient;
+
private String cloudSiteId = "cloudSiteId";
private String tenantId = "tenantId";
@@ -564,4 +573,38 @@ public class MsoHeatUtilsTest extends MsoHeatUtils {
Mockito.verify(heatUtils, times(0)).handleUnknownCreateStackFailure(stack, 120, cloudSiteId, tenantId);
}
+ @Test
+ public void testGetVfHeatTimeoutValue() {
+
+ VfModuleCustomization vfmc = new VfModuleCustomization();
+ VfModule vf = new VfModule();
+ HeatTemplate heat = new HeatTemplate();
+ heat.setTimeoutMinutes(110);
+ vf.setModuleHeatTemplate(heat);
+ vfmc.setVfModule(vf);
+
+ Mockito.when(catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID("uuid")).thenReturn(vfmc);
+
+ int timeout = heatUtils.getVfHeatTimeoutValue("uuid", false);
+ assertEquals(110, timeout);
+ Mockito.verify(catalogDbClient, times(1)).getVfModuleCustomizationByModelCuztomizationUUID("uuid");
+ }
+
+ @Test
+ public void testGetNetworkHeatTimeoutValue() {
+
+ NetworkResourceCustomization mc = new NetworkResourceCustomization();
+ NetworkResource nr = new NetworkResource();
+ HeatTemplate heat = new HeatTemplate();
+ heat.setTimeoutMinutes(110);
+ nr.setHeatTemplate(heat);
+ mc.setNetworkResource(nr);
+
+ Mockito.when(catalogDbClient.getNetworkResourceCustomizationByModelCustomizationUUID("uuid")).thenReturn(mc);
+
+ int timeout = heatUtils.getNetworkHeatTimeoutValue("uuid", "type");
+ assertEquals(110, timeout);
+ Mockito.verify(catalogDbClient, times(1)).getNetworkResourceCustomizationByModelCustomizationUUID("uuid");
+ }
+
}
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.8.1__AddColumnAdminProjectDomainName.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.8.1__AddColumnAdminProjectDomainName.sql
new file mode 100644
index 0000000000..a883466515
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.8.1__AddColumnAdminProjectDomainName.sql
@@ -0,0 +1,3 @@
+use catalogdb;
+
+ALTER TABLE identity_services ADD COLUMN ADMIN_PROJECT_DOMAIN_NAME varchar(255) DEFAULT 'Default'; \ No newline at end of file
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
index 489585c04b..9123ac9f36 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
@@ -962,31 +962,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
pollForCompletion = true;
}
- // Retrieve the Network Resource definition
- NetworkResource networkResource = null;
- if (commonUtils.isNullOrEmpty(modelCustomizationUuid)) {
- if (!commonUtils.isNullOrEmpty(networkType)) {
- networkResource = networkResourceRepo.findFirstByModelNameOrderByModelVersionDesc(networkType);
- }
- } else {
- NetworkResourceCustomization nrc =
- networkCustomRepo.findOneByModelCustomizationUUID(modelCustomizationUuid);
- if (nrc != null) {
- networkResource = nrc.getNetworkResource();
- }
- }
-
- int timeoutMinutes = 118;
- if (networkResource != null) {
- logger.debug(LOG_DEBUG_MSG, networkResource.toString());
- networkResource.getHeatTemplate().getTimeoutMinutes();
- HeatTemplate heat = networkResource.getHeatTemplate();
- if (heat != null && heat.getTimeoutMinutes() != null) {
- if (heat.getTimeoutMinutes() < 118) {
- timeoutMinutes = heat.getTimeoutMinutes();
- }
- }
- }
+ int timeoutMinutes = heat.getNetworkHeatTimeoutValue(modelCustomizationUuid, networkType);
try {
StackInfo stack =
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java
index c319fdc23c..ddbda5da62 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java
@@ -90,7 +90,9 @@ public class PollService extends ExternalTaskUtils {
JAXB.unmarshal(new StringReader(xmlRequest), DeleteVfModuleRequest.class);
boolean isMulticloud = vnfAdapterUtils.isMulticloudMode(null, req.getCloudSiteId());
if (!isMulticloud) {
- pollDeleteResource(req.getCloudSiteId(), req.getTenantId(), externalTask, success);
+ int timeoutMinutes = msoHeatUtils.getVfHeatTimeoutValue(req.getModelCustomizationUuid(), false);
+ pollDeleteResource(timeoutMinutes, req.getCloudSiteId(), req.getTenantId(), externalTask,
+ success);
} else {
success.setTrue();
}
@@ -100,7 +102,7 @@ public class PollService extends ExternalTaskUtils {
JAXB.unmarshal(new StringReader(xmlRequest), DeleteVolumeGroupRequest.class);
boolean isMulticloud = vnfAdapterUtils.isMulticloudMode(null, req.getCloudSiteId());
if (!isMulticloud) {
- pollDeleteResource(req.getCloudSiteId(), req.getTenantId(), externalTask, success);
+ pollDeleteResource(118, req.getCloudSiteId(), req.getTenantId(), externalTask, success);
} else {
success.setTrue();
}
@@ -109,7 +111,7 @@ public class PollService extends ExternalTaskUtils {
} else if ("deleteNetworkRequest".equals(requestType.get())) {
logger.debug("Executing External Task Poll Service for Delete Network");
DeleteNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), DeleteNetworkRequest.class);
- pollDeleteResource(req.getCloudSiteId(), req.getTenantId(), externalTask, success);
+ pollDeleteResource(118, req.getCloudSiteId(), req.getTenantId(), externalTask, success);
} else if ("updateNetworkRequest".equals(requestType.get())) {
UpdateNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), UpdateNetworkRequest.class);
pollUpdateResource(req.getCloudSiteId(), req.getTenantId(), externalTask, success);
@@ -152,9 +154,10 @@ public class PollService extends ExternalTaskUtils {
boolean pollRollbackStatus = externalTask.getVariable("PollRollbackStatus");
if (pollRollbackStatus) {
logger.debug("Executing External Task Poll Service for Rollback Create Volume Group");
- pollDeleteResource(req.getCloudSiteId(), req.getTenantId(), externalTask, success);
+ pollDeleteResource(118, req.getCloudSiteId(), req.getTenantId(), externalTask, success);
} else {
- pollCreateResource(req.getCloudSiteId(), req.getTenantId(), externalTask, success);
+ int timeoutMinutes = msoHeatUtils.getVfHeatTimeoutValue(req.getModelCustomizationUuid(), true);
+ pollCreateResource(timeoutMinutes, req.getCloudSiteId(), req.getTenantId(), externalTask, success);
}
} else {
success.setTrue();
@@ -167,12 +170,13 @@ public class PollService extends ExternalTaskUtils {
boolean isMulticloud = vnfAdapterUtils.isMulticloudMode(null, req.getCloudSiteId());
if (!isMulticloud) {
boolean pollRollbackStatus = externalTask.getVariable("PollRollbackStatus");
+ int timeoutMinutes = msoHeatUtils.getVfHeatTimeoutValue(req.getModelCustomizationUuid(), false);
if (pollRollbackStatus) {
logger.debug("Executing External Task Poll Service for Rollback Create Vf Module");
- pollDeleteResource(req.getCloudSiteId(), req.getTenantId(), externalTask, success);
+ pollDeleteResource(timeoutMinutes, req.getCloudSiteId(), req.getTenantId(), externalTask, success);
} else {
logger.debug("Executing External Task Poll Service for Create Vf Module");
- pollCreateResource(req.getCloudSiteId(), req.getTenantId(), externalTask, success);
+ pollCreateResource(timeoutMinutes, req.getCloudSiteId(), req.getTenantId(), externalTask, success);
}
} else {
success.setTrue();
@@ -183,29 +187,31 @@ public class PollService extends ExternalTaskUtils {
throws MsoException {
CreateNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), CreateNetworkRequest.class);
boolean pollRollbackStatus = externalTask.getVariable("PollRollbackStatus");
+ int timeoutMinutes =
+ msoHeatUtils.getNetworkHeatTimeoutValue(req.getModelCustomizationUuid(), req.getNetworkType());
if (pollRollbackStatus) {
logger.debug("Executing External Task Poll Service for Rollback Create Network");
- pollDeleteResource(req.getCloudSiteId(), req.getTenantId(), externalTask, success);
+ pollDeleteResource(timeoutMinutes, req.getCloudSiteId(), req.getTenantId(), externalTask, success);
} else {
logger.debug("Executing External Task Poll Service for Create Network");
- pollCreateResource(req.getCloudSiteId(), req.getTenantId(), externalTask, success);
+ pollCreateResource(timeoutMinutes, req.getCloudSiteId(), req.getTenantId(), externalTask, success);
}
}
- private void pollCreateResource(String cloudSiteId, String tenantId, ExternalTask externalTask,
+ private void pollCreateResource(int pollingTimeout, String cloudSiteId, String tenantId, ExternalTask externalTask,
MutableBoolean success) throws MsoException {
Stack currentStack = createCurrentStack(externalTask.getVariable("stackId"));
- Stack stack =
- msoHeatUtils.pollStackForStatus(1, currentStack, "CREATE_IN_PROGRESS", cloudSiteId, tenantId, false);
+ Stack stack = msoHeatUtils.pollStackForStatus(pollingTimeout, currentStack, "CREATE_IN_PROGRESS", cloudSiteId,
+ tenantId, false);
msoHeatUtils.postProcessStackCreate(stack, false, 0, false, cloudSiteId, tenantId, null);
success.setTrue();
}
- private void pollDeleteResource(String cloudSiteId, String tenantId, ExternalTask externalTask,
+ private void pollDeleteResource(int pollingTimeout, String cloudSiteId, String tenantId, ExternalTask externalTask,
MutableBoolean success) throws MsoException {
Stack currentStack = createCurrentStack(externalTask.getVariable("stackId"));
- Stack stack =
- msoHeatUtils.pollStackForStatus(1, currentStack, "DELETE_IN_PROGRESS", cloudSiteId, tenantId, true);
+ Stack stack = msoHeatUtils.pollStackForStatus(pollingTimeout, currentStack, "DELETE_IN_PROGRESS", cloudSiteId,
+ tenantId, true);
if (stack != null) { // if stack is null it was not found and no need to do post process
msoHeatUtils.postProcessStackDelete(stack);
}
@@ -245,5 +251,4 @@ public class PollService extends ExternalTaskUtils {
currentStack.setStackName(stackName);
return currentStack;
}
-
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java
index 26bce5f362..7acf953282 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java
@@ -158,6 +158,7 @@ public class MsoVnfAdapterImpl {
* @param outputs Holder for Map of VNF outputs from heat (assigned IPs, etc)
* @param rollback Holder for returning VnfRollback object
*/
+ @Deprecated
public void createVnf(String cloudSiteId, String cloudOwner, String tenantId, String vnfType, String vnfVersion,
String vnfName, String requestType, String volumeGroupHeatStackId, Map<String, Object> inputs,
Boolean failIfExists, Boolean backout, Boolean enableBridge, MsoRequest msoRequest, Holder<String> vnfId,
@@ -212,6 +213,7 @@ public class MsoVnfAdapterImpl {
* @param vnfName VNF Name or Openstack ID
* @param msoRequest Request tracking information for logs
*/
+ @Deprecated
public void deleteVnf(String cloudSiteId, String cloudOwner, String tenantId, String vnfName, MsoRequest msoRequest)
throws VnfException {
@@ -251,6 +253,7 @@ public class MsoVnfAdapterImpl {
* @param vnfName VNF Name or Openstack ID
* @param msoRequest Request tracking information for logs
*/
+ @Deprecated
public void deleteVnf(String cloudSiteId, String cloudOwner, String tenantId, String vnfName, MsoRequest msoRequest,
boolean pollStackStatus) throws VnfException {
@@ -988,29 +991,7 @@ public class MsoVnfAdapterImpl {
// call method which handles the conversion from Map<String,Object> to Map<String,String> for our expected
// Object types
outputs.value = this.convertMapStringObjectToStringString(stackOutputs);
- int timeoutMinutes = 118;
- VfModule vf = null;
- VfModuleCustomization vfmc = null;
- if (modelCustomizationUuid != null) {
- vfmc = vfModuleCustomRepo.findFirstByModelCustomizationUUIDOrderByCreatedDesc(modelCustomizationUuid);
- if (vfmc != null) {
- vf = vfmc.getVfModule();
- }
- if (vf != null) {
- logger.trace("Found vfModuleCust entry {}", vfmc.toString());
- HeatTemplate heat = vf.getModuleHeatTemplate();
- if (heat != null && heat.getTimeoutMinutes() != null) {
- if (heat.getTimeoutMinutes() < 118) {
- timeoutMinutes = heat.getTimeoutMinutes();
- }
- }
-
- } else {
- logger.debug(
- "Unable to find vfModuleCust with modelCustomizationUuid={} . Using default timeout for polling",
- modelCustomizationUuid);
- }
- }
+ int timeoutMinutes = msoHeatUtils.getVfHeatTimeoutValue(modelCustomizationUuid, false);
try {
StackInfo currentStack =
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/PollServiceTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/PollServiceTest.java
index 60826705fd..0214fdd265 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/PollServiceTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/PollServiceTest.java
@@ -52,15 +52,17 @@ public class PollServiceTest {
Mockito.when(mockExternalTask.getVariable("openstackAdapterTaskRequest")).thenReturn(xmlString);
Mockito.when(mockExternalTask.getVariable("PollRollbackStatus")).thenReturn(false);
Mockito.when(mockExternalTask.getVariable("stackId")).thenReturn("stackId/stack123");
- Mockito.when(msoHeatUtils.pollStackForStatus(eq(1), any(Stack.class), eq("CREATE_IN_PROGRESS"), eq("regionOne"),
- eq("0422ffb57ba042c0800a29dc85ca70f8"), eq(false))).thenReturn(new Stack());
+ Mockito.when(msoHeatUtils.pollStackForStatus(eq(118), any(Stack.class), eq("CREATE_IN_PROGRESS"),
+ eq("regionOne"), eq("0422ffb57ba042c0800a29dc85ca70f8"), eq(false))).thenReturn(new Stack());
+ Mockito.when(msoHeatUtils.getVfHeatTimeoutValue(any(), eq(false))).thenReturn(118);
// Mockito.doNothing().when(msoHeatUtils).postProcessStackCreate(Mockito.any(), Mockito.any(), Mockito.any(),
// Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any());
pollService.executeExternalTask(mockExternalTask, mockExternalTaskService);
- Mockito.verify(msoHeatUtils).pollStackForStatus(eq(1), any(Stack.class), eq("CREATE_IN_PROGRESS"),
+ Mockito.verify(msoHeatUtils).pollStackForStatus(eq(118), any(Stack.class), eq("CREATE_IN_PROGRESS"),
eq("regionOne"), eq("0422ffb57ba042c0800a29dc85ca70f8"), eq(false));
+ Mockito.verify(msoHeatUtils).getVfHeatTimeoutValue(any(), eq(false));
}
@@ -72,16 +74,16 @@ public class PollServiceTest {
Mockito.when(mockExternalTask.getVariable("openstackAdapterTaskRequest")).thenReturn(xmlString);
Mockito.when(mockExternalTask.getVariable("PollRollbackStatus")).thenReturn(true);
Mockito.when(mockExternalTask.getVariable("stackId")).thenReturn("stackId/stack123");
- Mockito.when(msoHeatUtils.pollStackForStatus(eq(1), any(), eq("DELETE_IN_PROGRESS"), eq("regionOne"),
+ Mockito.when(msoHeatUtils.pollStackForStatus(eq(118), any(), eq("DELETE_IN_PROGRESS"), eq("regionOne"),
eq("0422ffb57ba042c0800a29dc85ca70f8"), eq(true))).thenReturn(new Stack());
Mockito.doNothing().when(msoHeatUtils).postProcessStackDelete(Mockito.any());
-
+ Mockito.when(msoHeatUtils.getVfHeatTimeoutValue(any(), eq(false))).thenReturn(118);
pollService.executeExternalTask(mockExternalTask, mockExternalTaskService);
- Mockito.verify(msoHeatUtils).pollStackForStatus(eq(1), any(), eq("DELETE_IN_PROGRESS"), eq("regionOne"),
+ Mockito.verify(msoHeatUtils).pollStackForStatus(eq(118), any(), eq("DELETE_IN_PROGRESS"), eq("regionOne"),
eq("0422ffb57ba042c0800a29dc85ca70f8"), eq(true));
-
+ Mockito.verify(msoHeatUtils).getVfHeatTimeoutValue(any(), eq(false));
}
}