aboutsummaryrefslogtreecommitdiffstats
path: root/onap-client/onap_client/sdc
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 /onap-client/onap_client/sdc
parent856f003e49a0644917f15071de8335f77a6461dd (diff)
[VVP] Enhance VSP contributor logic
Issue-ID: VVP-423 Signed-off-by: stark, steven <steven.stark@att.com> Change-Id: I6175185d862ef70056fec24e16942a347d37ab94
Diffstat (limited to 'onap-client/onap_client/sdc')
-rw-r--r--onap-client/onap_client/sdc/vsp.py26
1 files changed, 11 insertions, 15 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
)