Skip to content

Commit e0a62ee

Browse files
committed
implement fix
1 parent 58844de commit e0a62ee

File tree

4 files changed

+257
-239
lines changed

4 files changed

+257
-239
lines changed

src/azure-cli/azure/cli/command_modules/appservice/access_restrictions.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
55

6-
import json
7-
86
from azure.cli.core.azclierror import (ResourceNotFoundError, ArgumentUsageError, InvalidArgumentValueError,
97
MutuallyExclusiveArgumentError)
108
from azure.cli.core.commands import LongRunningOperation
@@ -24,14 +22,14 @@
2422

2523
def show_webapp_access_restrictions(cmd, resource_group_name, name, slot=None):
2624
configs = get_site_configs(cmd, resource_group_name, name, slot)
27-
access_restrictions = json.dumps(configs.ip_security_restrictions, default=lambda x: x.__dict__)
28-
scm_access_restrictions = json.dumps(configs.scm_ip_security_restrictions, default=lambda x: x.__dict__)
25+
access_restrictions = [r.serialize() for r in (configs.ip_security_restrictions or [])]
26+
scm_access_restrictions = [r.serialize() for r in (configs.scm_ip_security_restrictions or [])]
2927
access_rules = {
3028
"scmIpSecurityRestrictionsUseMain": configs.scm_ip_security_restrictions_use_main,
3129
"ipSecurityRestrictionsDefaultAction": configs.ip_security_restrictions_default_action,
3230
"scmIpSecurityRestrictionsDefaultAction": configs.scm_ip_security_restrictions_default_action,
33-
"ipSecurityRestrictions": json.loads(access_restrictions),
34-
"scmIpSecurityRestrictions": json.loads(scm_access_restrictions)
31+
"ipSecurityRestrictions": access_restrictions,
32+
"scmIpSecurityRestrictions": scm_access_restrictions
3533
}
3634
return access_rules
3735

0 commit comments

Comments
 (0)