-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{Core} Fix 404 in long running delete operation #15884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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']: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even if we add this hack, Python SDK and its users will still suffers from this non-standard behavior.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have an open issue in https://github.com/Azure/azure-rest-api-specs to track this?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I opened an issue in our repo #15906 for service team to deal with.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on a disucssion with swagger reviewers, there are some existing services using 404 in LRO. For new swaggers, there should be validation tasks to catch it but for existing ones as long as the json is not modified with PRs, it will not be caught.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still think we should force service team to fix it, instead of patching it from our side, otherwise Python SDK and its users will still suffers from this non-standard behavior. |
||
| 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 | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.