Skip to content

Commit

Permalink
Merge pull request #5 from dscsolutions/FixBadRevert
Browse files Browse the repository at this point in the history
Fix bad revert
  • Loading branch information
TravisEz13 committed Sep 12, 2015
2 parents a07c992 + 97007ce commit 9a6b40d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ public void TestGetService()
{
//when service name is passed as argument in the cmdlet
getAzureVmDscExtensionStatusCmdlet.GetService(ServiceName, null);
Assert.Equal(ServiceName, getAzureVmDscExtensionStatusCmdlet.Service);
Assert.Equal(ServiceName, getAzureVmDscExtensionStatusCmdlet.ServiceName);

//when vm object is passed as argument in the cmdlet
getAzureVmDscExtensionStatusCmdlet.GetService("", GetAzureVM(ServiceName, ServiceName));
Assert.Equal(ServiceName, getAzureVmDscExtensionStatusCmdlet.Service);
Assert.Equal(ServiceName, getAzureVmDscExtensionStatusCmdlet.ServiceName);
}

[Fact]
public void TestGetVirtualMachineDscStatusContextListWithServiceName()
{
getAzureVmDscExtensionStatusCmdlet.Service = ServiceName;
getAzureVmDscExtensionStatusCmdlet.ServiceName = ServiceName;

// service has multiple vm's
var roles = new List<NSM.Role> {CreateRole("dscmachine01"), CreateRole("dscmachine02")};
Expand All @@ -59,7 +59,7 @@ public void TestGetVirtualMachineDscStatusContextListWithServiceName()
[Fact]
public void TestGetVirtualMachineDscStatusContextListWithServiceNameAndVmName()
{
getAzureVmDscExtensionStatusCmdlet.Service = ServiceName;
getAzureVmDscExtensionStatusCmdlet.ServiceName = ServiceName;
getAzureVmDscExtensionStatusCmdlet.Name = "dscmachine01";

// service has multiple vm's
Expand All @@ -84,7 +84,7 @@ public void TestGetVirtualMachineDscStatusContextListWithServiceNameAndVmName()
[Fact]
public void TestGetVirtualMachineDscStatusContextListWithServiceNameAndIncorrectVmName()
{
getAzureVmDscExtensionStatusCmdlet.Service = ServiceName;
getAzureVmDscExtensionStatusCmdlet.ServiceName = ServiceName;
getAzureVmDscExtensionStatusCmdlet.Name = "some-blah";

// service has multiple vm's
Expand All @@ -108,7 +108,7 @@ public void TestGetVirtualMachineDscStatusContextListWithServiceNameAndIncorrect
[Fact]
public void TestGetVirtualMachineDscStatusContextListWithVm()
{
getAzureVmDscExtensionStatusCmdlet.Service = ServiceName;
getAzureVmDscExtensionStatusCmdlet.ServiceName = ServiceName;
getAzureVmDscExtensionStatusCmdlet.VmName = "dscmachine02";

// service has multiple vm's
Expand All @@ -127,7 +127,7 @@ public void TestGetVirtualMachineDscStatusContextListWithVm()
[Fact]
public void TestCreateDscStatusContext()
{
getAzureVmDscExtensionStatusCmdlet.Service = ServiceName;
getAzureVmDscExtensionStatusCmdlet.ServiceName = ServiceName;

var roles = new List<NSM.Role> {CreateRole("dscmachine02")};
var roleInstances = new List<NSM.RoleInstance> {CreateRoleInstance("dscmachine02")};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public class GetAzureVmDscExtensionStatusCommand : IaaSDeploymentManagementCmdle
protected const string GetStatusByServiceAndVmNameParamSet = "GetStatusByServiceAndVMName";
protected const string GetStatusByVmParamSet = "GetStatusByVM";

internal string Service;
internal string VmName;

/// <summary>
Expand All @@ -94,6 +93,7 @@ protected override void ExecuteCommand()
{
ServiceManagementProfile.Initialize();
GetService(ServiceName, VM);

base.ExecuteCommand();

if (CurrentDeploymentNewSM == null)
Expand All @@ -118,7 +118,7 @@ internal void GetService(String serviceName, IPersistentVM vm)
{
if (!string.IsNullOrEmpty(serviceName))
{
Service = serviceName;
this.ServiceName = serviceName;
}
else
{
Expand All @@ -127,7 +127,7 @@ internal void GetService(String serviceName, IPersistentVM vm)
if (vmRoleContext == null)
return;

Service = vmRoleContext.ServiceName;
this.ServiceName = vmRoleContext.ServiceName;
VmName = vmRoleContext.Name;
}
}
Expand Down Expand Up @@ -207,7 +207,7 @@ internal VirtualMachineDscExtensionStatusContext CreateDscStatusContext(NSM.Role

var dscStatusContext = new VirtualMachineDscExtensionStatusContext
{
ServiceName = Service,
ServiceName = this.ServiceName,
Name = vmRole == null ? string.Empty : vmRole.RoleName,
Status = extensionSettingStatus.Status ?? string.Empty,
StatusCode = extensionSettingStatus.Code ?? -1,
Expand Down

0 comments on commit 9a6b40d

Please sign in to comment.