Skip to content

Commit

Permalink
styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddhant9868 committed Jul 5, 2024
1 parent dd9a782 commit fdb8744
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/scvmm/azext_scvmm/_client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def cf_vminstance_guest_agent(cli_ctx: AzCli, *_):
"""
return cf_scvmm(cli_ctx).guest_agents


def cf_machine(cli_ctx: AzCli, *_):
"""
Client factory for machines.
Expand Down
18 changes: 15 additions & 3 deletions src/scvmm/azext_scvmm/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,11 @@ def add_disk(
disks_update = []
vm = client.get(machine_id)
vm: VirtualMachineInstance = vm
if vm.properties is not None and vm.properties.storage_profile is not None and vm.properties.storage_profile.disks is not None:
if (
vm.properties is not None
and vm.properties.storage_profile is not None
and vm.properties.storage_profile.disks is not None
):
for disk in vm.properties.storage_profile.disks:
disk_update = VirtualDiskUpdate(
name=disk.name,
Expand Down Expand Up @@ -1502,7 +1506,11 @@ def update_disk(
disk_found = False
vm = client.get(machine_id)
vm: VirtualMachineInstance = vm
if vm.properties is not None and vm.properties.storage_profile is not None and vm.properties.storage_profile.disks is not None:
if (
vm.properties is not None
and vm.properties.storage_profile is not None
and vm.properties.storage_profile.disks is not None
):
for disk in vm.properties.storage_profile.disks:
disk_update = VirtualDiskUpdate(
name=disk.name,
Expand Down Expand Up @@ -1631,7 +1639,11 @@ def delete_disks(
disks_update = []
vm = client.get(machine_id)
vm: VirtualMachineInstance = vm
if vm.properties is not None and vm.properties.storage_profile is not None and vm.properties.storage_profile.disks is not None:
if (
vm.properties is not None
and vm.properties.storage_profile is not None
and vm.properties.storage_profile.disks is not None
):
for disk in vm.properties.storage_profile.disks:
if disk.name in disks_to_delete:
disks_to_delete[disk.name] = False
Expand Down

0 comments on commit fdb8744

Please sign in to comment.