@@ -80,20 +80,29 @@ def maestro_get_node(url, nodeid):
8080 return node_data
8181
8282
83- def maestro_get_nodes (url , limit , offset , filter ):
83+ def maestro_get_nodes (url , limit , offset , filter , paginate ):
8484 headers = {
8585 "Content-Type" : "application/json; charset=utf-8" ,
8686 }
87- url = url + "latest/nodes/fast?limit=" + str (limit ) + "&offset=" + str (offset )
8887
89- logging .info (f"Fetching Maestro nodes - limit: { limit } , offset: { offset } " )
90- if filter :
91- logging .debug (f"Applying filters: { filter } " )
92- for f in filter :
93- # TBD: We need to add translate filter to API
94- # if we need anything more complex than eq(=)
95- url = url + "&" + f
88+ if paginate :
89+ url = url + "latest/nodes/fast?limit=" + str (limit ) + "&offset=" + str (offset )
90+ logging .info (f"Fetching Maestro nodes - limit: { limit } , offset: { offset } " )
91+ if filter :
92+ for f in filter :
93+ logging .debug (f"Applying filters: { filter } " )
94+ # TBD: We need to add translate filter to API
95+ # if we need anything more complex than eq(=)
96+ url = url + "&" + f
9697
98+ else :
99+ url = url + "latest/nodes/fast"
100+ if filter :
101+ url = url + "?"
102+ for f in filter :
103+ # TBD: We need to add translate filter to API
104+ # if we need anything more complex than eq(=)
105+ url = url + "&" + f
97106 logging .debug (f"Full nodes URL: { url } " )
98107 maestro_print_api_call (url )
99108
@@ -190,18 +199,18 @@ def maestro_node_result(node):
190199 or result == "done"
191200 or result == "pass"
192201 ):
193- kci_msg_green_nonl ("PASS" )
202+ kci_msg_green ("PASS" , nl = False )
194203 elif result == None :
195- kci_msg_green_nonl ("PASS" )
204+ kci_msg_green ("PASS" , nl = False )
196205 else :
197- kci_msg_red_nonl ("FAIL" )
206+ kci_msg_red ("FAIL" , nl = False )
198207 else :
199208 if node ["result" ] == "pass" :
200- kci_msg_green_nonl ("PASS" )
209+ kci_msg_green ("PASS" , nl = False )
201210 elif node ["result" ] == "fail" :
202- kci_msg_red_nonl ("FAIL" )
211+ kci_msg_red ("FAIL" , nl = False )
203212 else :
204- kci_msg_yellow_nonl (node ["result" ])
213+ kci_msg_yellow (node ["result" ])
205214
206215 if node ["kind" ] == "checkout" :
207216 kci_msg_nonl (" branch checkout" )
0 commit comments