diff options
Diffstat (limited to 'adapters/mso-openstack-adapters')
9 files changed, 75 insertions, 246 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java index 999d27335b..6a42456715 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java @@ -40,6 +40,10 @@ public class AuditStackService { private static final Logger logger = LoggerFactory.getLogger(AuditStackService.class); + private static final String DEFAULT_AUDIT_LOCK_TIME = "60000"; + + private static final String DEFAULT_MAX_CLIENTS_FOR_TOPIC = "10"; + @Autowired public Environment env; @@ -53,41 +57,40 @@ public class AuditStackService { private AuditQueryStackService auditQueryStack; @PostConstruct - public void auditAddAAIInventory() throws Exception { + public void auditAddAAIInventory() { for (int i = 0; i < getMaxClients(); i++) { ExternalTaskClient client = createExternalTaskClient(); client.subscribe("InventoryAddAudit") - .lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", "60000"))) + .lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", DEFAULT_AUDIT_LOCK_TIME))) .handler(auditCreateStack::executeExternalTask).open(); } } @PostConstruct - public void auditDeleteAAIInventory() throws Exception { + public void auditDeleteAAIInventory() { for (int i = 0; i < getMaxClients(); i++) { ExternalTaskClient client = createExternalTaskClient(); client.subscribe("InventoryDeleteAudit") - .lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", "60000"))) + .lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", DEFAULT_AUDIT_LOCK_TIME))) .handler(auditDeleteStack::executeExternalTask).open(); } } @PostConstruct - public void auditQueryInventory() throws Exception { + public void auditQueryInventory() { for (int i = 0; i < getMaxClients(); i++) { ExternalTaskClient client = createExternalTaskClient(); client.subscribe("InventoryQueryAudit") - .lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", "60000"))) + .lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", DEFAULT_AUDIT_LOCK_TIME))) .handler(auditQueryStack::executeExternalTask).open(); } } - protected ExternalTaskClient createExternalTaskClient() throws Exception { + protected ExternalTaskClient createExternalTaskClient() { ClientRequestInterceptor interceptor = createClientRequestInterceptor(); - ExternalTaskClient client = ExternalTaskClient.create() - .baseUrl(env.getRequiredProperty("mso.workflow.endpoint")).maxTasks(1).addInterceptor(interceptor) - .asyncResponseTimeout(120000).backoffStrategy(new ExponentialBackoffStrategy(0, 0, 0)).build(); - return client; + return ExternalTaskClient.create().baseUrl(env.getRequiredProperty("mso.workflow.endpoint")).maxTasks(1) + .addInterceptor(interceptor).asyncResponseTimeout(120000) + .backoffStrategy(new ExponentialBackoffStrategy(0, 0, 0)).build(); } protected ClientRequestInterceptor createClientRequestInterceptor() { @@ -97,13 +100,11 @@ public class AuditStackService { } catch (IllegalStateException | GeneralSecurityException e) { logger.error("Error Decrypting Password", e); } - ClientRequestInterceptor interceptor = - new BasicAuthProvider(env.getRequiredProperty("mso.config.cadi.aafId"), auth); - return interceptor; + return new BasicAuthProvider(env.getRequiredProperty("mso.config.cadi.aafId"), auth); } protected int getMaxClients() { - return Integer.parseInt(env.getProperty("workflow.topics.maxClients", "10")); + return Integer.parseInt(env.getProperty("workflow.topics.maxClients", DEFAULT_MAX_CLIENTS_FOR_TOPIC)); } diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java index a9af3683f5..e95e9a3a83 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java @@ -11,9 +11,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -370,8 +370,8 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl); notifyPort.deleteNetworkNotification(messageId, false, exCat, eMsg, null); } catch (Exception e1) { - logger.error("{} {} Error sending createNetwork notification {} ", - MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, ErrorCode.DataError.getValue(), e1.getMessage(), e1); + logger.error(CREATE_NETWORK_ERROR_LOGMSG, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, + ErrorCode.DataError.getValue(), e1.getMessage(), e1); } return; 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 64f1b215d4..97c73a9e99 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 @@ -90,6 +90,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { private static final String NETWORK_FQDN = "network_fqdn"; private static final String CREATE_NETWORK_CONTEXT = "CreateNetwork"; private static final String NEUTRON_MODE = "NEUTRON"; + private static final String CLOUD_OWNER = "CloudOwner"; private static final Logger logger = LoggerFactory.getLogger(MsoNetworkAdapterImpl.class); @@ -310,7 +311,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { StackInfo heatStack = null; long queryNetworkStarttime = System.currentTimeMillis(); try { - heatStack = heat.queryStack(cloudSiteId, "CloudOwner", tenantId, networkName); + heatStack = heat.queryStack(cloudSiteId, CLOUD_OWNER, tenantId, networkName); } catch (MsoException me) { me.addContext(CREATE_NETWORK_CONTEXT); logger.error("{} {} Create Network (heat): query network {} in {}/{}: ", @@ -424,7 +425,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { try { if (backout == null) backout = true; - heatStack = heat.createStack(cloudSiteId, "CloudOwner", tenantId, networkName, null, template, + heatStack = heat.createStack(cloudSiteId, CLOUD_OWNER, tenantId, networkName, null, template, stackParams, true, heatTemplate.getTimeoutMinutes(), null, null, null, backout.booleanValue()); } catch (MsoException me) { me.addContext(CREATE_NETWORK_CONTEXT); @@ -607,7 +608,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { StackInfo heatStack = null; long queryStackStarttime = System.currentTimeMillis(); try { - heatStack = heat.queryStack(cloudSiteId, "CloudOwner", tenantId, networkName); + heatStack = heat.queryStack(cloudSiteId, CLOUD_OWNER, tenantId, networkName); } catch (MsoException me) { me.addContext(UPDATE_NETWORK_CONTEXT); logger.error("{} {} Exception - QueryStack query {} in {}/{} ", MessageEnum.RA_QUERY_NETWORK_EXC, @@ -727,7 +728,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { // Ignore MsoStackNotFound exception because we already checked. long updateStackStarttime = System.currentTimeMillis(); try { - heatStack = heatWithUpdate.updateStack(cloudSiteId, "CloudOwner", tenantId, networkId, template, + heatStack = heatWithUpdate.updateStack(cloudSiteId, CLOUD_OWNER, tenantId, networkId, template, stackParams, true, heatTemplate.getTimeoutMinutes()); } catch (MsoException me) { me.addContext(UPDATE_NETWORK_CONTEXT); @@ -841,8 +842,8 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { } else { String error = String.format( "Network Type:%s Version_Min:%s Version_Max:%s not supported on Cloud:%s with AIC_Version:%s", - networkType, networkType, networkResource.getAicVersionMin(), networkResource.getAicVersionMax(), - cloudSiteId, cloudSite.getCloudVersion()); + networkType, networkResource.getAicVersionMin(), networkResource.getAicVersionMax(), cloudSiteId, + cloudSite.getCloudVersion()); logger.error(LoggingAnchor.THREE, MessageEnum.RA_CONFIG_EXC, ErrorCode.DataError.getValue(), error); throw new NetworkException(error, MsoExceptionCategory.USERDATA); } @@ -919,7 +920,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { StackInfo heatStack = null; long queryStackStarttime = System.currentTimeMillis(); try { - heatStack = heat.queryStack(cloudSiteId, "CloudOwner", tenantId, networkNameOrId); + heatStack = heat.queryStack(cloudSiteId, CLOUD_OWNER, tenantId, networkNameOrId); } catch (MsoException me) { me.addContext("QueryNetwork"); logger.error("{} {} Exception - Query Network (heat): {} in {}/{} ", MessageEnum.RA_QUERY_NETWORK_EXC, @@ -1072,9 +1073,9 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { // was deleted. // So query first to report back if stack WAS deleted or just NOTOFUND StackInfo heatStack = null; - heatStack = heat.queryStack(cloudSiteId, "CloudOwner", tenantId, networkId); + heatStack = heat.queryStack(cloudSiteId, CLOUD_OWNER, tenantId, networkId); if (heatStack != null && heatStack.getStatus() != HeatStatus.NOTFOUND) { - heat.deleteStack(tenantId, "CloudOwner", cloudSiteId, networkId, true); + heat.deleteStack(tenantId, CLOUD_OWNER, cloudSiteId, networkId, true); networkDeleted.value = true; } else { networkDeleted.value = false; @@ -1157,7 +1158,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { try { // The deleteStack function in MsoHeatUtils returns success if the stack // was not found. So don't bother to query first. - heat.deleteStack(tenantId, "CloudOwner", cloudSiteId, networkId, true); + heat.deleteStack(tenantId, CLOUD_OWNER, cloudSiteId, networkId, true); } catch (MsoException me) { me.addContext("RollbackNetwork"); logger.error("{} {} Exception - Rollback Network (heat): {} in {}/{} ", @@ -1476,13 +1477,19 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { } if (subnet.getAllocationPools() != null) { - curR = curR + " allocation_pools:\n"; + StringBuilder tempBuf = new StringBuilder(); + tempBuf.append(curR); + tempBuf.append(" allocation_pools:\n"); for (Pool pool : subnet.getAllocationPools()) { if (!commonUtils.isNullOrEmpty(pool.getStart()) && !commonUtils.isNullOrEmpty(pool.getEnd())) { - curR = curR + " - start: " + pool.getStart() + "\n"; - curR = curR + " end: " + pool.getEnd() + "\n"; + tempBuf.append(" - start: "); + tempBuf.append(pool.getStart()); + tempBuf.append("\n end: "); + tempBuf.append(pool.getEnd()); + tempBuf.append("\n"); } } + curR = tempBuf.toString(); } resourcesBuf.append(curR); @@ -1491,7 +1498,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { curO = curO.replace("%subnetId%", subnet.getSubnetId()); outputsBuf.append(curO); - } // append resources and outputs in heatTemplate logger.debug("Tempate initial:{}", heatTemplate); @@ -1515,23 +1521,28 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { logger.debug("Subnet_Ipam Output JSON String:{} {}", obj.getClass(), jStr); JsonNode rootNode = mapper.readTree(jStr); - for (JsonNode sNode : rootNode.path("ipam_subnets")) { - logger.debug("Output Subnet Node {}", sNode.toString()); - String name = sNode.path("subnet_name").textValue(); - String uuid = sNode.path("subnet_uuid").textValue(); - String aaiId = name; // default - // try to find aaiId for name in input subnetList - if (subnets != null) { - for (Subnet subnet : subnets) { - if (subnet != null && !commonUtils.isNullOrEmpty(subnet.getSubnetName())) { - if (subnet.getSubnetName().equals(name)) { - aaiId = subnet.getSubnetId(); - break; + if (rootNode != null) { + for (JsonNode sNode : rootNode.path("ipam_subnets")) { + logger.debug("Output Subnet Node {}", sNode.toString()); + String name = sNode.path("subnet_name").textValue(); + String uuid = sNode.path("subnet_uuid").textValue(); + String aaiId = name; // default + // try to find aaiId for name in input subnetList + if (subnets != null) { + for (Subnet subnet : subnets) { + if (subnet != null && !commonUtils.isNullOrEmpty(subnet.getSubnetName())) { + if (subnet.getSubnetName().equals(name)) { + aaiId = subnet.getSubnetId(); + break; + } } } } + sMap.put(aaiId, uuid); // bpmn needs aaid to uuid map } - sMap.put(aaiId, uuid); // bpmn needs aaid to uuid map + } else { + logger.error("{} {} null rootNode - cannot get subnet-uuids", MessageEnum.RA_MARSHING_ERROR, + ErrorCode.DataError.getValue()); } } catch (Exception e) { logger.error("{} {} Exception getting subnet-uuids ", MessageEnum.RA_MARSHING_ERROR, diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java index df2c3a2973..4eb5d5637f 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java @@ -90,6 +90,7 @@ public class NetworkAdapterRest { private static final String TESTING_KEYWORD = "___TESTING___"; private String exceptionMsg = "Exception:"; private static final String SHARED = "shared"; + private static final String EXTERNAL = "external"; @Autowired private MsoNetworkAdapterImpl adapter; @@ -207,8 +208,8 @@ public class NetworkAdapterRest { shared = ctn.getShared(); } } - if (params.containsKey("external")) { - external = params.get("external"); + if (params.containsKey(EXTERNAL)) { + external = params.get(EXTERNAL); } else { if (ctn.getExternal() != null) { external = ctn.getExternal(); @@ -228,8 +229,8 @@ public class NetworkAdapterRest { } if (params.containsKey(SHARED)) shared = params.get(SHARED); - if (params.containsKey("external")) - external = params.get("external"); + if (params.containsKey(EXTERNAL)) + external = params.get(EXTERNAL); adapter.createNetwork(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(), req.getModelCustomizationUuid(), req.getNetworkName(), req.getProviderVlanNetwork().getPhysicalNetworkName(), @@ -603,8 +604,8 @@ public class NetworkAdapterRest { shared = ctn.getShared(); } } - if (params.containsKey("external")) { - external = params.get("external"); + if (params.containsKey(EXTERNAL)) { + external = params.get(EXTERNAL); } else { if (ctn.getExternal() != null) { external = ctn.getExternal(); @@ -624,8 +625,8 @@ public class NetworkAdapterRest { if (params.containsKey(SHARED)) { shared = params.get(SHARED); } - if (params.containsKey("external")) { - external = params.get("external"); + if (params.containsKey(EXTERNAL)) { + external = params.get(EXTERNAL); } adapter.updateNetwork(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(), req.getModelCustomizationUuid(), req.getNetworkStackId(), req.getNetworkName(), diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/CSAR.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/CSAR.java deleted file mode 100644 index 7786b872ef..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/CSAR.java +++ /dev/null @@ -1,189 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf; - -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.PrintStream; -import java.util.ArrayList; -import java.util.List; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; -import org.onap.so.adapters.vdu.VduArtifact; -import org.onap.so.adapters.vdu.VduArtifact.ArtifactType; -import org.onap.so.adapters.vdu.VduModelInfo; -import org.onap.so.adapters.vnf.exceptions.VnfException; -import com.google.common.io.Files; - -/** - * The purpose of this class is to create a CSAR byte array from Vdu inputs for the purpose of forwarding to a TOSCA - * orchestrator. - * - * @author DeWayne - * - */ -public class CSAR { - private static final String MANIFEST_FILENAME = "MANIFEST.MF"; - private VduModelInfo vduModel; - - public CSAR(VduModelInfo model) { - this.vduModel = model; - } - - /** - * Creates a byte array representation of a CSAR corresponding to the VduBlueprint arg in the constructor. - * - * @return - * @throws VnfException - */ - public byte[] create() { - File dir = Files.createTempDir(); - - /** - * Create subdir - */ - File metadir = new File(dir.getAbsolutePath() + "/TOSCA-Metadata"); - if (!metadir.mkdir()) { - throw new RuntimeException("CSAR TOSCA-Metadata directory create failed"); - } - - /** - * Organize model info for consumption - */ - VduArtifact mainTemplate = null; - List<VduArtifact> extraFiles = new ArrayList<>(); - for (VduArtifact artifact : vduModel.getArtifacts()) { - if (artifact.getType() == ArtifactType.MAIN_TEMPLATE) { - mainTemplate = artifact; - } else { - extraFiles.add(artifact); - } - } - - if (mainTemplate == null) { // make a dummy to avoid null pointers - mainTemplate = new VduArtifact("", new byte[0], null); - } - - /** - * Write template files - */ - try (OutputStream ofs = new FileOutputStream(new File(dir, mainTemplate.getName())); - PrintStream mfstream = - new PrintStream(new File(metadir.getAbsolutePath() + '/' + MANIFEST_FILENAME));) { - ofs.write(mainTemplate.getContent()); - - /** - * Write other files - */ - if (!extraFiles.isEmpty()) { - for (VduArtifact artifact : extraFiles) { - try (OutputStream out = new FileOutputStream(new File(dir, artifact.getName()));) { - out.write(artifact.getContent()); - } - } - } - - - /** - * Create manifest - */ - mfstream.println("TOSCA-Meta-File-Version: 1.0"); - mfstream.println("CSAR-Version: 1.1"); - mfstream.println("Created-by: ONAP"); - mfstream.println("Entry-Definitions: " + mainTemplate.getName()); - - /** - * ZIP it up - */ - ByteArrayOutputStream zipbytes = new ByteArrayOutputStream(); - ZipOutputStream zos = new ZipOutputStream(zipbytes); - compressTree(zos, "", dir, dir); - zos.close(); - return zipbytes.toByteArray(); - - } catch (Exception e) { - throw new RuntimeException("Failed to create CSAR: " + e.getMessage()); - } finally { - /** - * Clean up tmpdir - */ - deleteDirectory(dir); - } - } - - /** - * Private methods - */ - - /** - * Compresses (ZIPs) a directory tree - * - * @param dir - * @throws IOException - */ - private void compressTree(ZipOutputStream zos, String path, File basedir, File dir) throws IOException { - if (!dir.isDirectory()) - return; - - for (File f : dir.listFiles()) { - if (f.isDirectory()) { - String newpath = path + f.getName() + '/'; - ZipEntry entry = new ZipEntry(newpath); - zos.putNextEntry(entry); - zos.closeEntry(); - compressTree(zos, newpath, basedir, f); - } else { - ZipEntry ze = new ZipEntry( - f.getAbsolutePath().substring(basedir.getAbsolutePath().length() + 1).replaceAll("\\\\", "/")); - zos.putNextEntry(ze); - // read the file and write to ZipOutputStream - try (FileInputStream fis = new FileInputStream(f);) { - byte[] buffer = new byte[1024]; - int len; - while ((len = fis.read(buffer)) > 0) { - zos.write(buffer, 0, len); - } - } - zos.closeEntry(); - } - } - } - - private boolean deleteDirectory(File directory) { - if (directory.exists()) { - File[] files = directory.listFiles(); - if (null != files) { - for (int i = 0; i < files.length; i++) { - if (files[i].isDirectory()) { - deleteDirectory(files[i]); - } else { - files[i].delete(); - } - } - } - } - return (directory.delete()); - } -} 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 1d73bf21c9..af2fa24ff9 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 @@ -640,7 +640,11 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { StackInfo heatStack = null; try { - heatStack = heat.queryStack(cloudSiteId, cloudOwner, tenantId, vfModuleName); + if (heat != null) { + heatStack = heat.queryStack(cloudSiteId, cloudOwner, tenantId, vfModuleName); + } else { + throw new MsoHeatNotFoundException(); + } } catch (MsoException me) { String error = "Create VF Module: Query " + vfModuleName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me; diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java index 96e5db7ce7..f09fa34cb9 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java @@ -854,7 +854,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter { // Include aliases. String alias = htp.getParamAlias(); - if (alias != null && !alias.equals("") && !params.containsKey(alias)) { + if (alias != null && !"".equals(alias) && !params.containsKey(alias)) { params.put(alias, htp); } } diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java index d5fe285274..41bcc8c481 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java @@ -323,7 +323,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter { String type = templateParam.getParamType(); logger.debug("Parameter: {} is of type ", templateParam.getParamName(), type); - if (type.equalsIgnoreCase("number")) { + if ("number".equalsIgnoreCase(type)) { try { return Integer.valueOf(inputValue.toString()); } catch (Exception e) { diff --git a/adapters/mso-openstack-adapters/src/test/resources/schema.sql b/adapters/mso-openstack-adapters/src/test/resources/schema.sql index 7b3ffd7d30..9406bc445d 100644 --- a/adapters/mso-openstack-adapters/src/test/resources/schema.sql +++ b/adapters/mso-openstack-adapters/src/test/resources/schema.sql @@ -1109,6 +1109,7 @@ CREATE TABLE `vnf_resource_customization` ( `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `VNF_RESOURCE_MODEL_UUID` varchar(200) NOT NULL, `SERVICE_MODEL_UUID` varchar(200) NOT NULL, + `NF_DATA_VALID` tinyint(1) DEFAULT '0', `VNFCINSTANCEGROUP_ORDER` varchar(200) default NULL, PRIMARY KEY (`ID`), UNIQUE KEY `UK_vnf_resource_customization` (`MODEL_CUSTOMIZATION_UUID`,`SERVICE_MODEL_UUID`), |