Skip to content

Commit 0afd3c1

Browse files
committed
fix
1 parent f94842e commit 0afd3c1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/azure-cli/azure/cli/command_modules/vm/_vm_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,16 @@ def is_sku_available(cmd, sku_info, zone):
146146
if not sku_info.get('restrictions', []):
147147
return is_available
148148
for restriction in sku_info['restrictions']:
149-
if restriction.get('reason_code', '') == 'NotAvailableForSubscription':
149+
if restriction.get('reasonCode', '') == 'NotAvailableForSubscription':
150150
# The attribute location_info is not supported in versions 2017-03-30 and earlier
151151
if cmd.supported_api_version(max_api='2017-03-30'):
152152
is_available = False
153153
break
154154
if restriction['type'] == 'Zone' and not (
155-
set(sku_info['location_info'][0].get('zones', []) or []) - set(restriction['restriction_info'].get('zones', []) or [])):
155+
set(sku_info['locationInfo'][0].get('zones', []) or []) - set(restriction['restrictionInfo'].get('zones', []) or [])):
156156
is_restrict_zone = True
157157
if restriction['type'] == 'Location' and (
158-
sku_info['location_info'][0]['location'] in (restriction['restriction_info'].get('locations', []) or [])):
158+
sku_info['locationInfo'][0]['location'] in (restriction['restrictionInfo'].get('locations', []) or [])):
159159
is_restrict_location = True
160160

161161
if is_restrict_location or (is_restrict_zone and zone):

0 commit comments

Comments
 (0)