Skip to content

Commit

Permalink
fix 404 in LRO (#15884)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengzhou-msft authored Apr 22, 2021
1 parent 6728379 commit 2ff95ab
Show file tree
Hide file tree
Showing 2 changed files with 319 additions and 261 deletions.
12 changes: 8 additions & 4 deletions src/azure-cli-core/azure/cli/core/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -987,11 +987,15 @@ def __call__(self, poller):
except ClientException as client_exception:
from azure.cli.core.commands.arm import handle_long_running_operation_exception
self.progress_bar.stop()
if getattr(client_exception, 'status_code', None) == 404 and 'delete' in self.cli_ctx.data['command']:
logger.debug('Service returned 404 on the long-running delete operation. CLI treats it as delete '
'successfully but service should fix this behavior.')
return None
handle_long_running_operation_exception(client_exception)

self.progress_bar.end()
if poll_flag:
telemetry.poll_end()
finally:
self.progress_bar.end()
if poll_flag:
telemetry.poll_end()

return result

Expand Down
Loading

0 comments on commit 2ff95ab

Please sign in to comment.