aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstark, steven <steven.stark@att.com>2020-06-19 14:30:10 -0700
committerstark, steven <steven.stark@att.com>2020-06-19 14:30:49 -0700
commitb3e7a9fbcbf52ac095ca424f3f17610bf1e8df88 (patch)
tree4d9dd019de4db8d51b462beeca1d822ff703edbc
parent856f003e49a0644917f15071de8335f77a6461dd (diff)
[VVP] Enhance VSP contributor logic
Issue-ID: VVP-423 Signed-off-by: stark, steven <steven.stark@att.com> Change-Id: I6175185d862ef70056fec24e16942a347d37ab94
-rw-r--r--onap-client/onap_client/sdc/vsp.py26
-rw-r--r--onap-client/setup.py2
2 files changed, 12 insertions, 16 deletions
diff --git a/onap-client/onap_client/sdc/vsp.py b/onap-client/onap_client/sdc/vsp.py
index c958978..cd478e1 100644
--- a/onap-client/onap_client/sdc/vsp.py
+++ b/onap-client/onap_client/sdc/vsp.py
@@ -141,21 +141,17 @@ class VSP(Resource):
).response_data.get("results", [])
requestor_id = self.oc.sdc.vsp.catalog_resources["MODIFY_VSP_OWNER"].get("headers").get("USER_ID")
- for contributer in self.contributers:
- if (
- not user_exists(contributer, vsp_permissions, permission="Contributor")
- and contributer != requestor_id
- ):
- self.oc.sdc.vsp.add_vsp_contributer(
- user_id=contributer, software_product_id=self.software_product_id
- )
-
- if self.owner:
- requestor_id = self.oc.sdc.vsp.catalog_resources["MODIFY_VSP_OWNER"].get("headers").get("USER_ID")
- if (
- user_exists(requestor_id, vsp_permissions, permission="Owner")
- and self.owner != requestor_id
- ):
+ if user_exists(requestor_id, vsp_permissions, permission="Owner"):
+ for contributer in self.contributers:
+ if (
+ not user_exists(contributer, vsp_permissions, permission="Contributor")
+ and contributer != requestor_id
+ ):
+ self.oc.sdc.vsp.add_vsp_contributer(
+ user_id=contributer, software_product_id=self.software_product_id
+ )
+
+ if self.owner and self.owner != requestor_id:
self.oc.sdc.vsp.modify_vsp_owner(
user_id=self.owner, software_product_id=self.software_product_id
)
diff --git a/onap-client/setup.py b/onap-client/setup.py
index 6f16e46..bf1caaa 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.7.0",
+ version="0.7.1",
author="Steven Stark",
author_email="steven.stark@att.com",
description="Python API wrapper for ONAP applications",