diff options
author | stark, steven <steven.stark@att.com> | 2020-04-08 15:38:12 -0700 |
---|---|---|
committer | stark, steven <steven.stark@att.com> | 2020-04-08 16:12:37 -0700 |
commit | 71a1fd0d98c99692a25f9087ad5edfbd7cf00800 (patch) | |
tree | c1771dc78924344b90e79201b871017b0175a4e1 | |
parent | 298508191ae545ecf6eb2b7a56fd1d0828f20f0e (diff) |
[VVP] check for existing policy in vnf.py
Issue-ID: VVP-401
Signed-off-by: stark, steven <steven.stark@att.com>
Change-Id: Idd88dbe2031e182bb91c7f9b56f3525417cec676
-rw-r--r-- | onap-client/onap_client/sdc/vnf.py | 9 | ||||
-rw-r--r-- | onap-client/setup.py | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/onap-client/onap_client/sdc/vnf.py b/onap-client/onap_client/sdc/vnf.py index 5fa401c..d07882c 100644 --- a/onap-client/onap_client/sdc/vnf.py +++ b/onap-client/onap_client/sdc/vnf.py @@ -299,13 +299,18 @@ class VNF(Resource): def policy_exists(self, policy_name): """Checking the tosca model for a VF to see if a resource - has already been added""" + has already been added + + The policy name in the tosca model is all lowercase, + and if there are dashes in the VNF name they are + removed in the policy name. + """ policies = self.tosca.get("policies", {}) for p_name, policy in policies.items(): tosca_policy_name = policy.get("name").lower() - if tosca_policy_name.find("{}..{}".format(self.vnf_name.lower(), policy_name.lower())) != -1: + if tosca_policy_name.find("{}..{}".format(self.vnf_name.lower().replace("-", ""), policy_name.lower())) != -1: return True return False diff --git a/onap-client/setup.py b/onap-client/setup.py index 2624f9b..ea37a9e 100644 --- a/onap-client/setup.py +++ b/onap-client/setup.py @@ -47,7 +47,7 @@ for file in os.listdir("etc/payloads"): setuptools.setup( name="onap-client", - version="0.4.0", + version="0.4.1", author="Steven Stark", author_email="steven.stark@att.com", description="Python API wrapper for ONAP applications", |