diff options
Diffstat (limited to 'adapters')
7 files changed, 17 insertions, 48 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java index 3eb3fe188d..c648cc2137 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java @@ -525,7 +525,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin { private StackInfo getStackStatus(String cloudSiteId, String cloudOwner, String tenantId, String instanceId, boolean pollForCompletion, int timeoutMinutes, boolean backout) throws MsoException { - StackInfo stackInfo = new StackInfo(); + StackInfo stackInfo; // If client has requested a final response, poll for stack completion if (pollForCompletion) { diff --git a/adapters/mso-catalog-db-adapter/src/main/java/db/migration/R__CloudConfigMigration.java b/adapters/mso-catalog-db-adapter/src/main/java/db/migration/R__CloudConfigMigration.java index 354c3d07f7..691ae60afd 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/db/migration/R__CloudConfigMigration.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/db/migration/R__CloudConfigMigration.java @@ -128,8 +128,8 @@ public class R__CloudConfigMigration implements JdbcMigration, MigrationInfoProv private void migrateCloudIdentity(Collection<CloudIdentity> entities, Connection connection) throws SQLException { logger.debug("Starting migration for CloudConfig-->IdentityService"); String insert = - "INSERT INTO `identity_services` (`ID`, `IDENTITY_URL`, `MSO_ID`, `MSO_PASS`, `ADMIN_TENANT`, `MEMBER_ROLE`, `TENANT_METADATA`, `IDENTITY_SERVER_TYPE`, `IDENTITY_AUTHENTICATION_TYPE`, `LAST_UPDATED_BY`) " - + "VALUES (?,?,?,?,?,?,?,?,?,?);"; + "INSERT INTO `identity_services` (`ID`, `IDENTITY_URL`, `MSO_ID`, `MSO_PASS`, `ADMIN_TENANT`, `MEMBER_ROLE`, `TENANT_METADATA`, `IDENTITY_SERVER_TYPE`, `IDENTITY_AUTHENTICATION_TYPE`, `LAST_UPDATED_BY`, `PROJECT_DOMAIN_NAME`, `USER_DOMAIN_NAME`) " + + "VALUES (?,?,?,?,?,?,?,?,?,?,?,?);"; try (Statement stmt = connection.createStatement(); PreparedStatement ps = connection.prepareStatement(insert)) { @@ -157,6 +157,8 @@ public class R__CloudConfigMigration implements JdbcMigration, MigrationInfoProv ? cloudIdentity.getIdentityAuthenticationType().name() : null); ps.setString(10, FLYWAY); + ps.setString(11, cloudIdentity.getProjectDomainName()); + ps.setString(12, cloudIdentity.getUserDomainName()); ps.executeUpdate(); } } diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.2__UpdateCloudSiteTableSupportFabric.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.2__UpdateCloudSiteTableSupportFabric.sql new file mode 100644 index 0000000000..6578b5a297 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.2__UpdateCloudSiteTableSupportFabric.sql @@ -0,0 +1,3 @@ +use catalogdb; + +UPDATE cloud_sites SET SUPPORT_FABRIC = b'0' WHERE CLOUD_VERSION != '1.0.0';
\ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.3__UpdateVnfcCustResourceInputLength.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.3__UpdateVnfcCustResourceInputLength.sql new file mode 100644 index 0000000000..66c01538f7 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.3__UpdateVnfcCustResourceInputLength.sql @@ -0,0 +1,4 @@ +use catalogdb; + +ALTER TABLE vnfc_customization + MODIFY IF EXISTS RESOURCE_INPUT varchar(20000);
\ 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 52b97da61a..5641186eca 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 @@ -310,7 +310,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { // First, look up to see if the Network already exists (by name). // For HEAT orchestration of networks, the stack name will always match the network name StackInfo heatStack = null; - long queryNetworkStarttime = System.currentTimeMillis(); try { heatStack = heat.queryStack(cloudSiteId, CLOUD_OWNER, tenantId, networkName); } catch (MsoException me) { @@ -564,7 +563,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { // Verify that the Network exists // For Neutron-based orchestration, the networkId is the Neutron Network UUID. NetworkInfo netInfo = null; - long queryNetworkStarttime = System.currentTimeMillis(); try { netInfo = neutron.queryNetwork(networkId, tenantId, cloudSiteId); } catch (MsoException me) { @@ -608,7 +606,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { // First, look up to see that the Network already exists. // For Heat-based orchestration, the networkId is the network Stack ID. StackInfo heatStack = null; - long queryStackStarttime = System.currentTimeMillis(); try { heatStack = heat.queryStack(cloudSiteId, CLOUD_OWNER, tenantId, networkName); } catch (MsoException me) { @@ -728,7 +725,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { // Update the network stack // Ignore MsoStackNotFound exception because we already checked. - long updateStackStarttime = System.currentTimeMillis(); try { heatStack = heatWithUpdate.updateStack(cloudSiteId, CLOUD_OWNER, tenantId, networkId, template, stackParams, true, heatTemplate.getTimeoutMinutes()); @@ -892,9 +888,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { logger.debug("*** QUERY Network with Network: {} in {}/{}", networkNameOrId, cloudSiteId, tenantId); - // Will capture execution time for metrics - long startTime = System.currentTimeMillis(); - if (commonUtils.isNullOrEmpty(cloudSiteId) || commonUtils.isNullOrEmpty(tenantId) || commonUtils.isNullOrEmpty(networkNameOrId)) { @@ -919,7 +912,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { String neutronId = null; // Try Heat first, since networks may be named the same as the Heat stack StackInfo heatStack = null; - long queryStackStarttime = System.currentTimeMillis(); try { heatStack = heat.queryStack(cloudSiteId, CLOUD_OWNER, tenantId, networkNameOrId); } catch (MsoException me) { @@ -961,7 +953,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { // Query directly against the Neutron Network for the details // no RouteTargets available for ContrailV2 in neutron net-show // networkId is heatStackId - long queryNetworkStarttime = System.currentTimeMillis(); try { NetworkInfo netInfo = neutron.queryNetwork(neutronId, tenantId, cloudSiteId); if (netInfo != null) { diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/TenantAdapterRest.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/TenantAdapterRest.java index 6a38cc60e6..c782adec64 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/TenantAdapterRest.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/TenantAdapterRest.java @@ -100,7 +100,7 @@ public class TenantAdapterRest { logger.debug("createTenant enter: {}", req.toJsonString()); String newTenantId = null; - TenantRollback tenantRollback = new TenantRollback(); + TenantRollback tenantRollback; try { Holder<String> htenant = new Holder<>(); 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 2c78e593a1..2769f1c9b8 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 @@ -414,34 +414,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { return new HashMap<>(stringInputs); } - protected boolean callHeatbridge(String heatStackId) { - String executionDir = "/usr/local/lib/python2.7/dist-packages/heatbridge"; - String openstackIdentityUrl = "", username = "", password = "", tenant = "", region = "", owner = ""; - long waitTimeMs = 10000L; - try { - String[] cmdarray = {"/usr/bin/python", "HeatBridgeMain.py", openstackIdentityUrl, username, password, - tenant, region, owner, heatStackId}; - String[] envp = null; - File dir = new File(executionDir); - logger.debug("Calling HeatBridgeMain.py in {} with arguments {}", dir, Arrays.toString(cmdarray)); - Runtime r = Runtime.getRuntime(); - Process p = r.exec(cmdarray, envp, dir); - boolean wait = p.waitFor(waitTimeMs, TimeUnit.MILLISECONDS); - - logger.debug(" HeatBridgeMain.py returned {} with code {}", wait, p.exitValue()); - return wait && p.exitValue() == 0; - } catch (IOException e) { - logger.debug(" HeatBridgeMain.py failed with IO Exception! {}", e); - return false; - } catch (RuntimeException e) { - logger.debug(" HeatBridgeMain.py failed during runtime! {}", e); - return false; - } catch (Exception e) { - logger.debug(" HeatBridgeMain.py failed for unknown reasons! {}", e); - return false; - } - } - private void heatbridge(StackInfo heatStack, String cloudOwner, String cloudSiteId, String tenantId, String genericVnfName, String vfModuleId) { try { @@ -632,11 +604,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { vfRollback.setIsBase(isBaseRequest); vfRollback.setModelCustomizationUuid(mcu); - // Put data into A&AI through Heatstack - if (enableBridge != null && enableBridge) { - callHeatbridge(baseVfHeatStackId); - } - // handle a nestedStackId if sent- this one would be for the volume - so applies to both Vf and Vnf StackInfo nestedHeatStack = null; Map<String, Object> nestedVolumeOutputs = null; @@ -1156,8 +1123,10 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { } } logger.debug("VF Module {} successfully created", vfModuleName); - // call heatbridge - heatbridge(heatStack, cloudOwner, cloudSiteId, tenantId, genericVnfName, vfModuleId); + if (enableBridge != null && enableBridge) { + // call heatbridge + heatbridge(heatStack, cloudOwner, cloudSiteId, tenantId, genericVnfName, vfModuleId); + } } catch (Exception e) { logger.debug("unhandled exception in create VF", e); throw new VnfException("Exception during create VF " + e.getMessage()); |