From 42160a6a1cb7ff34daffec3564318ee477009c07 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Mon, 18 Feb 2019 18:54:04 -0800 Subject: fix a POL500 issue when creating a VSPfrom a tosca VNF, a POL500 was reported Change-Id: I8d942b81689f35cdeb16aa4b0925371394bb639c Issue-ID: SDC-1983 Signed-off-by: Liang Ding --- .../sdc/be/components/impl/ResourceBusinessLogic.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'catalog-be') diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java index efbaaa61db..82f7c32524 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java @@ -5106,11 +5106,15 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { actualVfName = vfResourceName; actualType = nodeResourceType; } - + String nameWithouNamespacePrefix; try { StringBuilder toscaResourceName = new StringBuilder(Constants.USER_DEFINED_RESOURCE_NAMESPACE_PREFIX); - String nameWithouNamespacePrefix = nodeTypeFullName + if (!nodeTypeFullName.contains(Constants.USER_DEFINED_RESOURCE_NAMESPACE_PREFIX)){ + nameWithouNamespacePrefix = nodeTypeFullName; + } else { + nameWithouNamespacePrefix = nodeTypeFullName .substring(Constants.USER_DEFINED_RESOURCE_NAMESPACE_PREFIX.length()); + } String[] findTypes = nameWithouNamespacePrefix.split("\\."); String resourceType = findTypes[0]; String actualName = nameWithouNamespacePrefix.substring(resourceType.length()); @@ -5181,4 +5185,4 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { return super.shouldUpgradeToLatestDerived(clonedComponent); } } -} \ No newline at end of file +} -- cgit 1.2.3-korg