File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -1199,12 +1199,16 @@ def _list_with_local_order(
1199
1199
def _delete (self ) -> None :
1200
1200
"""Deletes this Vertex AI resource. WARNING: This deletion is permanent."""
1201
1201
_LOGGER .log_action_start_against_resource ("Deleting" , "" , self )
1202
- lro = getattr (self .api_client , self ._delete_method )(name = self .resource_name )
1203
- _LOGGER .log_action_started_against_resource_with_lro (
1204
- "Delete" , "" , self .__class__ , lro
1202
+ possible_lro = getattr (self .api_client , self ._delete_method )(
1203
+ name = self .resource_name
1205
1204
)
1206
- lro .result ()
1207
- _LOGGER .log_action_completed_against_resource ("deleted." , "" , self )
1205
+
1206
+ if possible_lro :
1207
+ _LOGGER .log_action_started_against_resource_with_lro (
1208
+ "Delete" , "" , self .__class__ , possible_lro
1209
+ )
1210
+ possible_lro .result ()
1211
+ _LOGGER .log_action_completed_against_resource ("deleted." , "" , self )
1208
1212
1209
1213
1210
1214
class VertexAiResourceNounWithFutureManager (_VertexAiResourceNounPlus , FutureManager ):
You can’t perform that action at this time.
0 commit comments