Skip to content

Commit 1bd35ea

Browse files
committed
protection
1 parent 89c41db commit 1bd35ea

File tree

3 files changed

+682
-684
lines changed

3 files changed

+682
-684
lines changed

src/azure-cli/azure/cli/command_modules/vm/custom.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4085,12 +4085,19 @@ def update_vmss(cmd, resource_group_name, name, license_type=None, no_wait=False
40854085
if not vmss.protection_policy:
40864086
vmss.protection_policy = VMProtectionPolicy()
40874087

4088-
if protect_from_scale_in is not None:
4089-
vmss.protection_policy.protect_from_scale_in = protect_from_scale_in
4090-
40914088
if protect_from_scale_set_actions is not None:
40924089
vmss.protection_policy.protect_from_scale_set_actions = protect_from_scale_set_actions
40934090

4091+
if protect_from_scale_in is not None:
4092+
vmss.protection_policy.protect_from_scale_in = protect_from_scale_in
4093+
VirtualMachineScaleSetVM = cmd.get_models('VirtualMachineScaleSetVM')
4094+
kwargs['parameters'] = VirtualMachineScaleSetVM(protection_policy=kwargs['parameters'].protection_policy,
4095+
location=kwargs['parameters'].location,
4096+
license_type=kwargs['parameters'].license_type,
4097+
user_data=kwargs['parameters'].user_data)
4098+
return sdk_no_wait(no_wait, client.virtual_machine_scale_set_vms.begin_update,
4099+
resource_group_name, name, instance_id, **kwargs)
4100+
40944101
return sdk_no_wait(no_wait, client.virtual_machine_scale_set_vms.begin_update,
40954102
resource_group_name, name, instance_id, **kwargs)
40964103

0 commit comments

Comments
 (0)