Skip to content

Commit

Permalink
Fixes bugs caused by version changes (ansible-collections#1756)
Browse files Browse the repository at this point in the history
* Fixes bugs caused by version changes

* Small change
  • Loading branch information
Fred-sun authored Nov 12, 2024
1 parent b2513b2 commit 1ea1e6b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plugins/modules/azure_rm_manageddisk.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,13 +605,13 @@ def attach(self, resource_group, vm_name, disk):
lun = item.lun

# prepare the data disk
params = self.disk_models.ManagedDiskParameters(id=disk.get('id'), storage_account_type=disk.get('storage_account_type'))
caching_options = self.disk_models.CachingTypes[self.attach_caching] if self.attach_caching and self.attach_caching != '' else None
params = self.compute_models.ManagedDiskParameters(id=disk.get('id'), storage_account_type=disk.get('storage_account_type'))
caching_options = self.compute_models.CachingTypes[self.attach_caching] if self.attach_caching and self.attach_caching != '' else None
# pylint: disable=missing-kwoa
data_disk = self.disk_models.DataDisk(lun=lun,
create_option=self.compute_models.DiskCreateOptionTypes.attach,
managed_disk=params,
caching=caching_options)
data_disk = self.compute_models.DataDisk(lun=lun,
create_option=self.compute_models.DiskCreateOptionTypes.attach,
managed_disk=params,
caching=caching_options)
vm.storage_profile.data_disks.append(data_disk)
return self._update_vm(resource_group, vm_name, vm)

Expand Down

0 comments on commit 1ea1e6b

Please sign in to comment.