File ac_avoid_httpstatus.patch of Package azure-cli.28525
diff -Nru azure-cli-2.17.1.orig/azure/cli/command_modules/appservice/custom.py azure-cli-2.17.1/azure/cli/command_modules/appservice/custom.py
--- azure-cli-2.17.1.orig/azure/cli/command_modules/appservice/custom.py 2020-12-31 09:24:48.000000000 +0100
+++ azure-cli-2.17.1/azure/cli/command_modules/appservice/custom.py 2023-03-10 20:12:07.136693958 +0100
@@ -20,7 +20,6 @@
import sys
import uuid
from functools import reduce
-from http import HTTPStatus
from six.moves.urllib.request import urlopen # pylint: disable=import-error, ungrouped-imports
import OpenSSL.crypto
@@ -4134,9 +4133,9 @@
result = client.web_apps.delete_host_secret_slot(resource_group_name, name, key_type, key_name, slot, raw=True)
result = client.web_apps.delete_host_secret(resource_group_name, name, key_type, key_name, raw=True)
- if result.response.status_code == HTTPStatus.NO_CONTENT:
+ if result.response.status_code == 204: # HTTPStatus.NO_CONTENT
return "Successfully deleted key '{}' of type '{}' from function app '{}'".format(key_name, key_type, name)
- if result.response.status_code == HTTPStatus.NOT_FOUND:
+ if result.response.status_code == 404: # HTTPStatus.NOT_FOUND
return "Key '{}' of type '{}' does not exist in function app '{}'".format(key_name, key_type, name)
return result
@@ -4153,9 +4152,9 @@
client = web_client_factory(cmd.cli_ctx)
result = client.web_apps.delete_function(resource_group_name, name, function_name, raw=True)
- if result.response.status_code == HTTPStatus.NO_CONTENT:
+ if result.response.status_code == 204: # HTTPStatus.NO_CONTENT
return "Successfully deleted function '{}' from app '{}'".format(function_name, name)
- if result.response.status_code == HTTPStatus.NOT_FOUND:
+ if result.response.status_code == 404: # HTTPStatus.NOT_FOUND
return "Function '{}' does not exist in app '{}'".format(function_name, name)
return result
@@ -4201,8 +4200,8 @@
raw=True)
result = client.web_apps.delete_function_secret(resource_group_name, name, function_name, key_name, raw=True)
- if result.response.status_code == HTTPStatus.NO_CONTENT:
+ if result.response.status_code == 204: # HTTPStatus.NO_CONTENT
return "Successfully deleted key '{}' from function '{}'".format(key_name, function_name)
- if result.response.status_code == HTTPStatus.NOT_FOUND:
+ if result.response.status_code == 404: # HTTPStatus.NOT_FOUND
return "Key '{}' does not exist in function '{}'".format(key_name, function_name)
return result