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/openstack/utils/MsoHeatUtils.java2
-rw-r--r--adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsTest.java2
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V6.0__AddNamingPolicyToService.sql8
-rw-r--r--adapters/mso-openstack-adapters/src/test/resources/schema.sql4
4 files changed, 13 insertions, 3 deletions
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 350f14c3a9..b634b0c3a5 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
@@ -326,7 +326,7 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
Stack latestStack = null;
while (true) {
latestStack = queryHeatStack(heatClient, stack.getStackName() + "/" + stack.getId());
- statusHandler.updateStackStatus(stack);
+ statusHandler.updateStackStatus(latestStack);
logger.debug("Polling: {} ({})", latestStack.getStackStatus(), latestStack.getStackName());
if (stackStatus.equals(latestStack.getStackStatus())) {
if (numberOfPollingAttempts <= 0) {
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 c2edd9ca9b..28ad069f8b 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
@@ -126,7 +126,7 @@ public class MsoHeatUtilsTest extends MsoHeatUtils {
doReturn(latestStack).when(heatUtils).queryHeatStack(isA(Heat.class), eq("stackName/id"));
doReturn(heatClient).when(heatUtils).getHeatClient(cloudSiteId, tenantId);
Stack actual = heatUtils.pollStackForStatus(1, stack, "CREATE_IN_PROGRESS", cloudSiteId, tenantId);
- Mockito.verify(stackStatusHandler, times(1)).updateStackStatus(stack);
+ Mockito.verify(stackStatusHandler, times(1)).updateStackStatus(latestStack);
Mockito.verify(heatUtils, times(1)).queryHeatStack(isA(Heat.class), eq("stackName/id"));
assertEquals(true, actual != null);
}
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V6.0__AddNamingPolicyToService.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V6.0__AddNamingPolicyToService.sql
new file mode 100644
index 0000000000..3c45507b81
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V6.0__AddNamingPolicyToService.sql
@@ -0,0 +1,8 @@
+USE catalogdb;
+
+ALTER TABLE service
+ADD IF NOT EXISTS ONAP_GENERATED_NAMING tinyint(1) DEFAULT NULL;
+
+ALTER TABLE service
+ADD IF NOT EXISTS NAMING_POLICY varchar(200) DEFAULT NULL;
+
diff --git a/adapters/mso-openstack-adapters/src/test/resources/schema.sql b/adapters/mso-openstack-adapters/src/test/resources/schema.sql
index 83023e53db..7b3ffd7d30 100644
--- a/adapters/mso-openstack-adapters/src/test/resources/schema.sql
+++ b/adapters/mso-openstack-adapters/src/test/resources/schema.sql
@@ -803,7 +803,9 @@ CREATE TABLE `service` (
`WORKLOAD_CONTEXT` varchar(200) DEFAULT NULL,
`SERVICE_CATEGORY` varchar(200) DEFAULT NULL,
`RESOURCE_ORDER` varchar(200) default NULL,
- OVERALL_DISTRIBUTION_STATUS varchar(45),
+ `OVERALL_DISTRIBUTION_STATUS` varchar(45),
+ `ONAP_GENERATED_NAMING` TINYINT(1) DEFAULT NULL,
+ `NAMING_POLICY` varchar(200) DEFAULT NULL,
PRIMARY KEY (`MODEL_UUID`),
KEY `fk_service__tosca_csar1_idx` (`TOSCA_CSAR_ARTIFACT_UUID`),
CONSTRAINT `fk_service__tosca_csar1` FOREIGN KEY (`TOSCA_CSAR_ARTIFACT_UUID`) REFERENCES `tosca_csar` (`ARTIFACT_UUID`) ON DELETE CASCADE ON UPDATE CASCADE