Fix tag rackoon version from job info
Relataed_Prod: PRODX-54314
Change-Id: Iac352bac8fac212423cfcfc8c26ededf2627b988
diff --git a/rp_reporter/rp_reporter/batch_reporter.py b/rp_reporter/rp_reporter/batch_reporter.py
index fa57867..5a9a8ea 100755
--- a/rp_reporter/rp_reporter/batch_reporter.py
+++ b/rp_reporter/rp_reporter/batch_reporter.py
@@ -83,7 +83,7 @@
return f"[#{self.job_number} {self.job_status}]({self.job_url}) "
def add_test_result(
- self, test_name:str=None, testrail_url:str=None, rp_url:str=None, statistics:str=None
+ self, test_name: str = None, testrail_url: str = None, rp_url: str = None, statistics: str = None
):
testrail_msg = f"[TestRailURL]({testrail_url})" if testrail_url else ""
self.rp_url = rp_url
@@ -139,14 +139,14 @@
tags["dvr"] = False
if vpnaas := jmespath.search(
- "items[*].spec.features.neutron.extensions.vpnaas.enabled", osdpl_dict
+ "items[*].spec.features.neutron.extensions.vpnaas.enabled", osdpl_dict
):
tags["vpnaas"] = vpnaas[0]
else:
tags["vpnaas"] = False
if nova_images := jmespath.search(
- "items[*].spec.features.nova.images.backend", osdpl_dict
+ "items[*].spec.features.nova.images.backend", osdpl_dict
):
tags["nova.images.backend"] = nova_images[0]
@@ -154,7 +154,7 @@
def get_image_from_describe(
- job_obj, describe_file_pattern, image_pattern, from_artifactory=False
+ job_obj, describe_file_pattern, image_pattern, from_artifactory=False
):
if from_artifactory:
local_describe_file = job_obj.get_artifacts(describe_file_pattern)
@@ -222,7 +222,7 @@
all_logs = job.get_logs()
for log in grep(
- text=all_logs, patterns=catch_logs, context_size=8, blacklist=blacklist
+ text=all_logs, patterns=catch_logs, context_size=8, blacklist=blacklist
):
# LOG.error("Attach logs {}".format("\n".join(log)))
rp_client.log(time=timestamp(), message="\n".join(log), item_id=subjob_item_id)
@@ -321,7 +321,7 @@
run_tags.update(get_tags_from_osdpl(osdpl_file))
rp_client.update_test_item(attributes=run_tags,
item_uuid=launch_id)
- description.rockoon_version = tags.get("rockoon_version")
+ description.rockoon_version = run_tags.get("rockoon_version")
case "tempest-runner-k8s":
title = "Tempest"
@@ -384,7 +384,7 @@
f"Can't found 'test_check_downtime_statistic_result.xml' in {child.url}"
)
test_results_files = [f"{artifactory_url}/artifacts/"
- f"test_check_downtime_statistic_result.xml"]
+ f"test_check_downtime_statistic_result.xml"]
case "collect-openstack-kaas-artifacts":
artifactory_url = child.description.split("url: ")[-1]
@@ -451,15 +451,15 @@
end_time=timestamp(),
attributes=run_tags,
description=str(description)
- + f"\nPod Logs {artifactory_url}/pod-logs.tar.gz",
+ + f"\nPod Logs {artifactory_url}/pod-logs.tar.gz",
)
print(f"report is here {report_url}")
if JENKINS_USER or JENKINS_PASSWORD:
print("Pushing new description to job...")
try:
job.description = (
- job.description + f"<br><br> "
- f"<a href='{report_url}'>Link to ReportPortal</a> <br>"
+ job.description + f"<br><br> "
+ f"<a href='{report_url}'>Link to ReportPortal</a> <br>"
)
except Exception as e:
print(f"Can't push description to {job=}: {e}")