Skip to content

Commit 335a3d6

Browse files
author
Power Cloud Robot
authored
Merge pull request #56 from KeerthanaAP/all_jobs
Added changes to check node details of compact run
2 parents 9c00ca6 + 94b8475 commit 335a3d6

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

CI_JobHistory.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -169,22 +169,14 @@ def display_ci_links(config_data):
169169
ci_name_list.append(ci_name)
170170
print(j,'',ci_name)
171171
j=j+1
172-
print(j, " All")
173-
174-
172+
print(j, " All the above")
175173
option = input("Select the required ci's serial number with a space ")
176-
177174
selected_options = option.split()
178-
179-
180175
for ci in selected_options:
181176
try:
182177
ci_to_int = int(ci)
183-
if 0 < ci_to_int <= len(config_data):
178+
if 0 < ci_to_int <= len(config_data)+1:
184179
options_int_list.append(ci_to_int)
185-
elif ci_to_int == len(config_data) + 1:
186-
for j in range (1, len(config_data)+1):
187-
options_int_list.append(j)
188180
else:
189181
return_value = "Enter the options in range of 1 to " + str(len(config_data)+1)
190182
print(return_value)
@@ -199,15 +191,15 @@ def display_ci_links(config_data):
199191

200192
selected_ci = config_vars.get('Settings', 'selected_ci')
201193
options_int_list = [int(value) for value in selected_ci.split(',')]
202-
if len(ci_name_list)+1 in options_int_list:
203-
options_int_list = [x for x in range(1, len(ci_name_list)+1)]
204194

195+
if len(config_data)+1 in options_int_list:
196+
return config_data
205197

206198
for i in options_int_list:
207199
config_temp_data = {ci_name_list[i-1]: config_data[ci_name_list[i-1]]}
208200
selected_config_data.update(config_temp_data)
209201
config_temp_data = {}
210-
202+
211203
return selected_config_data
212204

213205
def get_query_options():

monitor.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,6 @@ def get_node_status(spy_link):
359359
Returns:
360360
string: Node Status.
361361
'''
362-
363362
job_type,job_platform = job_classifier(spy_link)
364363

365364
check_for_gather_libvirt_dir = check_if_gather_libvirt_dir_exists(spy_link,job_type)
@@ -371,7 +370,7 @@ def get_node_status(spy_link):
371370

372371
node_log_url = PROW_VIEW_URL + spy_link[8:] + \
373372
"/artifacts/" + job_type +"/artifacts/oc_cmds/nodes"
374-
373+
375374
try:
376375
node_log_response = requests.get(node_log_url, verify=False, timeout=15)
377376
if "NAME" in node_log_response.text:
@@ -380,7 +379,7 @@ def get_node_status(spy_link):
380379
return "Some Nodes are in NotReady state"
381380
elif response_str.count("control-plane,master") != 3:
382381
return "Not all master nodes are up and running"
383-
elif (job_platform == "mce" and response_str.count("worker") != 3) or (job_platform != "mce" and response_str.count("worker-") != 2):
382+
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):
384383
return "Not all worker nodes are up and running"
385384
else:
386385
return "Node details not found"

0 commit comments

Comments
 (0)