disk fact should return create_option value (#42398)

This commit is contained in:
Yuwei Zhou 2018-07-10 16:16:28 +08:00 committed by Yunge Zhu
commit e9bf3c70e6
3 changed files with 21 additions and 20 deletions

View file

@ -146,16 +146,17 @@ except ImportError:
def managed_disk_to_dict(managed_disk):
os_type = None
if managed_disk.os_type:
os_type = managed_disk.os_type.name
create_data = managed_disk.creation_data
return dict(
id=managed_disk.id,
name=managed_disk.name,
location=managed_disk.location,
tags=managed_disk.tags,
create_option=create_data.create_option.value.lower(),
source_uri=create_data.source_uri,
source_resource_uri=create_data.source_resource_id,
disk_size_gb=managed_disk.disk_size_gb,
os_type=os_type,
os_type=managed_disk.os_type.value if managed_disk.os_type else None,
storage_account_type=managed_disk.sku.name.value,
managed_by=managed_disk.managed_by
)