From 848002df8332278213ff16a3b0cec78dc4c83ec7 Mon Sep 17 00:00:00 2001 From: "Danfeng Liu (c)" Date: Mon, 14 Oct 2019 11:35:33 +0800 Subject: [PATCH] Fix an error in prepary.py in Jenkins upgrade pipeline, which is a 'if' position error in project metadata population. Signed-off-by: Danfeng Liu (c) --- .../robot-cases/Group3-Upgrade/prepare_v17.py | 28 ++++++------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/tests/robot-cases/Group3-Upgrade/prepare_v17.py b/tests/robot-cases/Group3-Upgrade/prepare_v17.py index 19b9fa2a6..b694b994b 100644 --- a/tests/robot-cases/Group3-Upgrade/prepare_v17.py +++ b/tests/robot-cases/Group3-Upgrade/prepare_v17.py @@ -61,26 +61,16 @@ class HarborAPI: def update_project_setting(self, project, public, contenttrust, preventrunning, preventseverity, scanonpush): r = request(url+"projects?name="+project+"", 'get') projectid = str(r.json()[0]['project_id']) - if args.version == "1.6": - payload = { - "metadata": { - "public": public, - "enable_content_trust": contenttrust, - "prevent_vulnerable_images_from_running": preventrunning, - "prevent_vulnerable_images_from_running_severity": preventseverity, - "automatically_scan_images_on_push": scanonpush - } - } - else: - payload = { - "metadata": { - "public": public, - "enable_content_trust": contenttrust, - "prevent_vul": preventrunning, - "severity": preventseverity, - "auto_scan": scanonpush - } + payload = { + "metadata": { + "public": public, + "enable_content_trust": contenttrust, + "prevent_vul": preventrunning, + "severity": preventseverity, + "auto_scan": scanonpush } + } + body=dict(body=payload) request(url+"projects/"+projectid+"", 'put', **body)