File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
generic-orchestration-samples/setup/setup_call_health_check Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change 33DUT_MODEL = "Putshell"
44
55
6+ class HealtCheckException (Exception ):
7+ pass
8+
9+
610# ========== Primary Function ==========
711def run_dut_health_check (sandbox , components = None ):
812 """
@@ -18,12 +22,17 @@ def run_dut_health_check(sandbox, components=None):
1822 dut_resources = [resource for resource in resources
1923 if resource .ResourceModelName == DUT_MODEL ]
2024 if not dut_resources :
21- raise Exception ("No Juniper " )
25+ raise Exception ("No DUT resource found " )
2226
2327 dut1 = dut_resources [0 ]
2428
25- api .ExecuteCommand (reservationId = res_id ,
26- targetName = dut1 .Name ,
27- targetType = "Resource" ,
28- commandName = "health_check" ,
29- printOutput = True )
29+ try :
30+ api .ExecuteCommand (reservationId = res_id ,
31+ targetName = dut1 .Name ,
32+ targetType = "Resource" ,
33+ commandName = "health_check" ,
34+ printOutput = True )
35+ except Exception as e :
36+ err_msg = f"Issue caught during health check. { str (e )} "
37+ api .WriteMessageToReservationOutput (err_msg )
38+ raise HealtCheckException (err_msg )
You can’t perform that action at this time.
0 commit comments