Skip to content

Commit 539ae60

Browse files
committed
Fix Remove-AzureAvailabilitySet issue
1 parent 0edcfa4 commit 539ae60

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/FunctionalTest.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -280,21 +280,13 @@ public void AzureAvailabilitySetTest()
280280
vmPowershellCmdlets.UpdateAzureVM(vmName, serviceName, vm);
281281
Assert.IsTrue(Verify.AzureAvailabilitySet(vmPowershellCmdlets.GetAzureVM(vmName, serviceName).VM, testAVSetName));
282282

283-
vm = vmPowershellCmdlets.SetAzureAvailabilitySet(vmName, serviceName, string.Empty);
284-
vmPowershellCmdlets.UpdateAzureVM(vmName, serviceName, vm);
285-
Assert.IsTrue(Verify.AzureAvailabilitySet(vmPowershellCmdlets.GetAzureVM(vmName, serviceName).VM, string.Empty));
286-
287-
vm = vmPowershellCmdlets.SetAzureAvailabilitySet(vmName, serviceName, testAVSetName);
288-
vmPowershellCmdlets.UpdateAzureVM(vmName, serviceName, vm);
289-
Assert.IsTrue(Verify.AzureAvailabilitySet(vmPowershellCmdlets.GetAzureVM(vmName, serviceName).VM, testAVSetName));
290-
291283
vm = vmPowershellCmdlets.SetAzureAvailabilitySet(vmName, serviceName, null);
292284
vmPowershellCmdlets.UpdateAzureVM(vmName, serviceName, vm);
293285
Assert.IsTrue(Verify.AzureAvailabilitySet(vmPowershellCmdlets.GetAzureVM(vmName, serviceName).VM, testAVSetName));
294286

295287
vm = vmPowershellCmdlets.RemoveAzureAvailabilitySet(vmName, serviceName);
296288
vmPowershellCmdlets.UpdateAzureVM(vmName, serviceName, vm);
297-
Assert.IsTrue(Verify.AzureAvailabilitySet(vmPowershellCmdlets.GetAzureVM(vmName, serviceName).VM, testAVSetName));
289+
Assert.IsTrue(Verify.AzureAvailabilitySet(vmPowershellCmdlets.GetAzureVM(vmName, serviceName).VM, null));
298290

299291
pass = true;
300292
}

src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/AvailabilitySets/RemoveAzureAvailabilitySet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class RemoveAzureAvailabilitySet : VirtualMachineConfigurationCmdletBase
2323
protected override void ProcessRecord()
2424
{
2525
base.ProcessRecord();
26-
this.VM.GetInstance().AvailabilitySetName = null;
26+
this.VM.GetInstance().AvailabilitySetName = string.Empty;
2727
this.WriteObject(this.VM, true);
2828
}
2929
}

0 commit comments

Comments
 (0)