File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ def _request(
134134 return Response (e .code , e .read (), e .headers )
135135 except URLError as e :
136136 # TODO: Add other errors here; we need to handle them in modules.
137+ # TimeoutError is handled in the rest_client
137138 if (
138139 e .args
139140 and isinstance (e .args , tuple )
Original file line number Diff line number Diff line change @@ -84,6 +84,9 @@ def shutdown(
8484 dict (forceShutdown = force_shutdown ),
8585 check_mode ,
8686 )
87+ # TimeoutError is handled in rest_client.create_record:
88+ # except TimeoutError as e:
89+ # raise errors.ScaleComputingError(f"Request timed out: {e}")
8790 except ScaleComputingError as e :
8891 # To avoid timeout when there are a lot of VMs to shutdown
8992 if "Request timed out" in str (e ):
@@ -92,10 +95,9 @@ def shutdown(
9295 # get cluster until "[Errno 111] Connection refused"
9396 Cluster .get (rest_client )
9497 sleep (5 )
95- except ScaleComputingError as e2 :
96- if "Connection refused" in str (e2 ): # cluster is shutdown
97- pass
98- else :
99- raise e2 # Some other unexpected error
100- else :
101- raise e # UnexpectedAPIResponse error
98+ except ConnectionRefusedError :
99+ pass # cluster is shutdown
100+ except ScaleComputingError as e2 : # Some other unexpected error
101+ raise e2
102+ else : # UnexpectedAPIResponse error
103+ raise e
You can’t perform that action at this time.
0 commit comments