diff --git a/src/scvmm/azext_scvmm/_client_factory.py b/src/scvmm/azext_scvmm/_client_factory.py index 4d2ea4e9942..190978cc5b2 100644 --- a/src/scvmm/azext_scvmm/_client_factory.py +++ b/src/scvmm/azext_scvmm/_client_factory.py @@ -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. diff --git a/src/scvmm/azext_scvmm/custom.py b/src/scvmm/azext_scvmm/custom.py index 58d712b7c97..b411f419e72 100644 --- a/src/scvmm/azext_scvmm/custom.py +++ b/src/scvmm/azext_scvmm/custom.py @@ -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, @@ -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, @@ -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