File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/azure-cli/azure/cli/command_modules/storage/operations Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -119,10 +119,18 @@ def _get_client(client, kwargs):
119119 dir_client = client .get_directory_client (directory_path = total_path )
120120 exists = False
121121 from azure .core .exceptions import ClientAuthenticationError
122+ from azure .core .exceptions import ResourceExistsError
122123 try :
123124 exists = dir_client .exists ()
124125 except ClientAuthenticationError :
125126 exists = False
127+ except ResourceExistsError as ex :
128+ if hasattr (ex , "error_code" ) and ex .error_code == "DeletePending" :
129+ # translate delete pending flag as file/dir not exists.
130+ exists = False
131+ else :
132+ raise ex
133+
126134 if not exists :
127135 dir_client = client .get_directory_client (directory_path = directory_path )
128136 client = dir_client .get_file_client (file_name = file_name )
You can’t perform that action at this time.
0 commit comments