Skip to content

Commit ffbf688

Browse files
committed
Incorporating feedback from partner team
1 parent 55ede77 commit ffbf688

File tree

11 files changed

+25
-21
lines changed

11 files changed

+25
-21
lines changed

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Providers/Providers/IaasVmPsBackupProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
using Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models;
2626
using Microsoft.Azure.Commands.RecoveryServices.Backup.Properties;
2727
using Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.HydraAdapter;
28-
28+
using Microsoft.WindowsAzure.Commands.Utilities.Common;
2929

3030
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.ProviderModel
3131
{
@@ -838,7 +838,7 @@ private HttpStatusCode TrackRefreshContainerOperation(string operationResultLink
838838
var response = HydraAdapter.GetRefreshContainerOperationResultByURL(operationResultLink);
839839
status = response.StatusCode;
840840

841-
Thread.Sleep(checkFrequency);
841+
TestMockSupport.Delay(checkFrequency);
842842
}
843843
catch (Exception ex)
844844
{

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/Container/GetAzureRmBackupManagementServer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2727
/// <summary>
2828
/// Get list of containers
2929
/// </summary>
30-
[Cmdlet(VerbsCommon.Get, "AzureRmBackupManagementServer"), OutputType(typeof(List<AzureRmRecoveryServicesContainerBase>), typeof(AzureRmRecoveryServicesContainerBase))]
30+
[Cmdlet(VerbsCommon.Get, "AzureRmBackupManagementServer"), OutputType(typeof(AzureRmRecoveryServicesContainerBase))]
3131
public class GetAzureRmBackupManagementServer : RecoveryServicesBackupCmdletBase
3232
{
3333
[Parameter(Mandatory = false, HelpMessage = ParamHelpMsg.Container.Name)]
@@ -57,7 +57,7 @@ public override void ExecuteCmdlet()
5757
containerModels = containerModels.Where(x => x.Name == this.Name).ToList();
5858
}
5959
}
60-
WriteObject(containerModels);
60+
WriteObject(containerModels, enumerateCollection: true);
6161
});
6262
}
6363
}

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/Container/GetAzureRmRecoveryServicesContainer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2727
/// <summary>
2828
/// Get list of containers
2929
/// </summary>
30-
[Cmdlet(VerbsCommon.Get, "AzureRmRecoveryServicesContainer"), OutputType(typeof(List<AzureRmRecoveryServicesContainerBase>), typeof(AzureRmRecoveryServicesContainerBase))]
30+
[Cmdlet(VerbsCommon.Get, "AzureRmRecoveryServicesContainer"), OutputType(typeof(AzureRmRecoveryServicesContainerBase))]
3131
public class GetAzureRmRecoveryServicesContainer : RecoveryServicesBackupCmdletBase
3232
{
3333
[Parameter(Mandatory = true, HelpMessage = ParamHelpMsg.Container.ContainerType)]
@@ -74,7 +74,7 @@ public override void ExecuteCmdlet()
7474
}
7575
else
7676
{
77-
WriteObject(containerModels);
77+
WriteObject(containerModels, enumerateCollection: true);
7878
}
7979
});
8080
}

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/Item/GetAzureRmRecoveryServicesItem.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2626
/// <summary>
2727
/// Get list of items
2828
/// </summary>
29-
[Cmdlet(VerbsCommon.Get, "AzureRmRecoveryServicesItem"), OutputType(typeof(List<AzureRmRecoveryServicesItemBase>), typeof(AzureRmRecoveryServicesItemBase))]
29+
[Cmdlet(VerbsCommon.Get, "AzureRmRecoveryServicesItem"), OutputType(typeof(AzureRmRecoveryServicesItemBase))]
3030
public class GetAzureRmRecoveryServicesItem : RecoveryServicesBackupCmdletBase
3131
{
3232
[Parameter(Mandatory = true, HelpMessage = ParamHelpMsg.Item.Container)]
@@ -74,7 +74,7 @@ public override void ExecuteCmdlet()
7474
}
7575
else
7676
{
77-
WriteObject(itemModels);
77+
WriteObject(itemModels, enumerateCollection: true);
7878
}
7979
});
8080
}

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/Jobs/GetAzureRmRecoveryServicesJob.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2424
/// <summary>
2525
/// Get list of jobs
2626
/// </summary>
27-
[Cmdlet(VerbsCommon.Get, "AzureRmRecoveryServicesJob"), OutputType(typeof(List<AzureRmRecoveryServicesJobBase>), typeof(AzureRmRecoveryServicesJobBase))]
27+
[Cmdlet(VerbsCommon.Get, "AzureRmRecoveryServicesJob"), OutputType(typeof(AzureRmRecoveryServicesJobBase))]
2828
public class GetAzureRmRecoveryServicesJob : RecoveryServicesBackupCmdletBase
2929
{
3030
[Parameter(Mandatory = false, HelpMessage = ParamHelpMsg.Job.StatusFilter, Position = 1)]
@@ -159,7 +159,7 @@ public override void ExecuteCmdlet()
159159
WriteDebug("Number of jobs fetched: " + result.Count);
160160
if (resultCount != 1)
161161
{
162-
WriteObject(result);
162+
WriteObject(result, enumerateCollection: true);
163163
}
164164
else
165165
{

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/Jobs/StopAzureRmRecoveryServicesJob.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
using Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models;
2121
using Microsoft.Azure.Commands.RecoveryServices.Backup.Helpers;
2222
using Microsoft.Azure.Commands.RecoveryServices.Backup.Properties;
23+
using Microsoft.WindowsAzure.Commands.Utilities.Common;
2324

2425
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2526
{
@@ -56,7 +57,7 @@ public override void ExecuteCmdlet()
5657

5758
while (cancelStatus.StatusCode == HttpStatusCode.Accepted)
5859
{
59-
Thread.Sleep(15 * 1000);
60+
TestMockSupport.Delay(15 * 1000);
6061
cancelStatus = HydraAdapter.GetJobOperationStatus(JobId, opId);
6162
}
6263

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/Jobs/WaitAzureRmRecoveryServicesJob.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@
1919
using Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models;
2020
using Microsoft.Azure.Commands.RecoveryServices.Backup.Helpers;
2121
using Microsoft.Azure.Commands.RecoveryServices.Backup.Properties;
22+
using Microsoft.WindowsAzure.Commands.Utilities.Common;
2223

2324
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2425
{
25-
[Cmdlet("Wait", "AzureRmRecoveryServicesJob"), OutputType(typeof(List<AzureRmRecoveryServicesJobBase>), typeof(AzureRmRecoveryServicesJobBase))]
26+
[Cmdlet("Wait", "AzureRmRecoveryServicesJob"), OutputType(typeof(AzureRmRecoveryServicesJobBase))]
2627
public class WaitAzureRmRecoveryServicesJob : RecoveryServicesBackupCmdletBase
2728
{
2829
[Parameter(Mandatory = true, HelpMessage = ParamHelpMsg.Job.WaitJobOrListFilter, ValueFromPipeline = true, Position = 1)]
@@ -103,7 +104,7 @@ public override void ExecuteCmdlet()
103104
}
104105

105106
// sleep for 30 seconds before checking again
106-
Thread.Sleep(30 * 1000);
107+
TestMockSupport.Delay(30 * 1000);
107108
}
108109

109110
if (finalJobs.Count == 1)
@@ -112,7 +113,7 @@ public override void ExecuteCmdlet()
112113
}
113114
else
114115
{
115-
WriteObject(finalJobs);
116+
WriteObject(finalJobs, enumerateCollection: true);
116117
}
117118
});
118119
}

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/ProtectionPolicy/GetAzureRmRecoveryServicesPolicy.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
3030
/// Get list of protection policies
3131
/// </summary>
3232
[Cmdlet(VerbsCommon.Get, "AzureRmRecoveryServicesBackupProtectionPolicy", DefaultParameterSetName = NoParamSet),
33-
OutputType(typeof(List<AzureRmRecoveryServicesBackupPolicyBase>), typeof(AzureRmRecoveryServicesBackupPolicyBase))]
33+
OutputType(typeof(AzureRmRecoveryServicesBackupPolicyBase))]
3434
public class GetAzureRmRecoveryServicesProtectionPolicy : RecoveryServicesBackupCmdletBase
3535
{
3636
protected const string PolicyNameParamSet = "PolicyNameParamSet";
@@ -131,8 +131,8 @@ public override void ExecuteCmdlet()
131131
WriteDebug("Successfully got response from service");
132132

133133
policyList = ConversionHelpers.GetPolicyModelList(respList);
134-
WriteObject(policyList);
135-
}
134+
WriteObject(policyList, enumerateCollection: true);
135+
}
136136
});
137137
}
138138
}

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/RecoveryPoint/GetAzureRMRecoveryServicesRecoveryPoint.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2626
{
27-
[Cmdlet(VerbsCommon.Get, "AzureRMRecoveryServicesRecoveryPoint"), OutputType(typeof(List<AzureRmRecoveryServicesRecoveryPointBase>), typeof(AzureRmRecoveryServicesRecoveryPointBase))]
27+
[Cmdlet(VerbsCommon.Get, "AzureRMRecoveryServicesRecoveryPoint"), OutputType(typeof(AzureRmRecoveryServicesRecoveryPointBase))]
2828
public class GetAzureRMRecoveryServicesRecoveryPoint : RecoveryServicesBackupCmdletBase
2929
{
3030
internal const string DateTimeFilterParameterSet = "DateTimeFilter";
@@ -81,7 +81,7 @@ public override void ExecuteCmdlet()
8181
}
8282
else
8383
{
84-
WriteObject(rpList);
84+
WriteObject(rpList, enumerateCollection: true);
8585
}
8686
}
8787
else if (this.ParameterSetName == RecoveryPointIdParameterSet)

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/Restore/RestoreAzureRMRecoveryServicesBackupItem.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
using ResourcesNS = Microsoft.Azure.Management.Resources;
2727
using Newtonsoft.Json.Linq;
2828
using Microsoft.Azure.Commands.RecoveryServices.Backup.Properties;
29+
using Microsoft.WindowsAzure.Commands.Utilities.Common;
2930

3031
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
3132
{
@@ -99,7 +100,7 @@ public override void ExecuteCmdlet()
99100
{
100101
WriteDebug(String.Format("Restore inProgress"));
101102
response = HydraAdapter.GetProtectedItemOperationStatusByURL(jobResponse.AzureAsyncOperation);
102-
System.Threading.Thread.Sleep(TimeSpan.FromSeconds(5));
103+
TestMockSupport.Delay(TimeSpan.FromSeconds(5));
103104
}
104105

105106
if (response.OperationStatus.Status == "Completed")

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/RecoveryServicesBackupCmdletBase.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
using System.Threading;
3131
using Microsoft.Azure.Commands.Common.Authentication;
3232
using Microsoft.Azure.Commands.Common.Authentication.Models;
33+
using Microsoft.WindowsAzure.Commands.Utilities.Common;
3334

3435
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
3536
{
@@ -154,7 +155,7 @@ public BackUpOperationStatusResponse WaitForOperationCompletionUsingStatusLink(
154155
while (response.OperationStatus.Status == OperationStatusValues.InProgress.ToString())
155156
{
156157
WriteDebug("Tracking operation completion using status link: " + statusUrlLink);
157-
Thread.Sleep(_defaultSleepForOperationTracking * 1000);
158+
TestMockSupport.Delay(_defaultSleepForOperationTracking * 1000);
158159
response = hydraFunc(statusUrlLink);
159160
}
160161

0 commit comments

Comments
 (0)