Skip to content

Commit b6f2d6f

Browse files
author
Power Cloud Robot
authored
Merge pull request #69 from alokgoswami-ag/fix-get-brief-job-info
Fix get brief job info to ensure it returns iterable object.
2 parents 36310e5 + a1aaccc commit b6f2d6f

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

monitor.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,16 +371,28 @@ def get_node_status(spy_link):
371371

372372
node_log_url = PROW_VIEW_URL + spy_link[8:] + \
373373
"/artifacts/" + job_type +"/artifacts/oc_cmds/nodes"
374+
375+
pattern=r"(\d+\.\d+)"
376+
match=re.search(pattern,spy_link[8:])
377+
version=float(match.group(1))
378+
if "upgrade" in spy_link:
379+
version=version-0.01
380+
374381

375382
try:
376383
node_log_response = requests.get(node_log_url, verify=False, timeout=15)
377384
if "NAME" in node_log_response.text:
385+
if version > 4.15 and job_platform == "libvirt":
386+
workers="compute-"
387+
else:
388+
workers="worker-"
389+
378390
response_str=node_log_response.text
379391
if "NotReady" in response_str:
380392
return "Some Nodes are in NotReady state"
381393
elif response_str.count("control-plane,master") != 3:
382394
return "Not all master nodes are up and running"
383-
elif ((job_platform == "mce" or "compact" in node_log_url ) and response_str.count("worker") != 3) or ((job_platform != "mce" and "compact" not in node_log_url) and response_str.count("worker-") != 2):
395+
elif ((job_platform == "mce" or "compact" in node_log_url ) and response_str.count("worker") != 3) or ((job_platform != "mce" and "compact" not in node_log_url) and response_str.count(workers) != 2):
384396
return "Not all worker nodes are up and running"
385397
else:
386398
return "Node details not found"
@@ -1098,7 +1110,7 @@ def get_next_page_first_build_date(ci_next_page_spylink,end_date):
10981110
def get_brief_job_info(build_list,prow_ci_name,zone=None):
10991111

11001112
"""
1101-
Gets brief information of all the jobs.
1113+
Gets brief information of all the jobs
11021114
11031115
Args:
11041116
build_list: list of builds
@@ -1110,7 +1122,7 @@ def get_brief_job_info(build_list,prow_ci_name,zone=None):
11101122

11111123
if isinstance(build_list,str):
11121124
print(build_list)
1113-
return 1
1125+
return []
11141126
summary_list = []
11151127

11161128
i=0

p_periodic.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"4.14 heavy build": "periodic-ci-openshift-multiarch-master-nightly-4.14-ocp-heavy-build-ovn-remote-libvirt-ppc64le",
1515
"4.15 libvirt": "periodic-ci-openshift-multiarch-master-nightly-4.15-ocp-e2e-ovn-remote-libvirt-ppc64le",
1616
"4.15 powervs original": "periodic-ci-openshift-multiarch-master-nightly-4.15-ocp-e2e-ovn-ppc64le-powervs-original",
17-
"4.15 powervs siguid": "periodic-ci-openshift-multiarch-master-nightly-4.15-ocp-e2e-ovn-ppc64le-powervs-siguid",
1817
"4.15 heavy build": "periodic-ci-openshift-multiarch-master-nightly-4.15-ocp-heavy-build-ovn-remote-libvirt-ppc64le",
1918
"4.15 to 4.16 upgrade": "periodic-ci-openshift-multiarch-master-nightly-4.16-upgrade-from-nightly-4.15-ocp-ovn-remote-libvirt-ppc64le",
2019
"4.16 libvirt": "periodic-ci-openshift-multiarch-master-nightly-4.16-ocp-e2e-ovn-remote-libvirt-ppc64le",

0 commit comments

Comments
 (0)