Skip to content

Commit

Permalink
Lexicalized resource ids should get 'subscription' instead of' subscr…
Browse files Browse the repository at this point in the history
…iption_id' (ansible-collections#1720)
  • Loading branch information
Fred-sun authored Sep 19, 2024
1 parent e7fcbc3 commit 29d60b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/module_utils/azure_rm_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ def parse_resource_to_dict(self, resource):
'''
resource_dict = parse_resource_id(resource) if not isinstance(resource, dict) else resource
resource_dict['resource_group'] = resource_dict.get('resource_group', self.resource_group)
resource_dict['subscription_id'] = resource_dict.get('subscription_id', self.subscription_id)
resource_dict['subscription_id'] = resource_dict.get('subscription', self.subscription_id)
return resource_dict

def serialize_obj(self, obj, class_name, enum_modules=None):
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/azure_rm_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,15 @@ def resolve_storage_source(self, source):
self.fail("source parameter should be in type string or dictionary")
if tokenize.get('type') == 'disks':
disk = format_resource_id(tokenize['name'],
tokenize.get('subscription_id') or self.subscription_id,
tokenize.get('subscription') or self.subscription_id,
'Microsoft.Compute',
'disks',
tokenize.get('resource_group') or self.resource_group)
return (blob_uri, disk, snapshot)

if tokenize.get('type') == 'snapshots':
snapshot = format_resource_id(tokenize['name'],
tokenize.get('subscription_id') or self.subscription_id,
tokenize.get('subscription') or self.subscription_id,
'Microsoft.Compute',
'snapshots',
tokenize.get('resource_group') or self.resource_group)
Expand Down

0 comments on commit 29d60b0

Please sign in to comment.