Skip to content

Commit 0d90486

Browse files
committed
minor fixes in common code and policy cmdlets
1 parent 6cfd0ae commit 0d90486

File tree

6 files changed

+11
-7
lines changed

6 files changed

+11
-7
lines changed

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Cmdlets.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
<Compile Include="Cmdlets\Container\UnregisterAzureRmBackupManagementServer.cs" />
8484
<Compile Include="Cmdlets\Container\UnregisterAzureRmRecoveryServicesBackupContainer.cs" />
8585
<Compile Include="Cmdlets\Item\DisableAzureRmRecoveryServicesProtection.cs" />
86-
<Compile Include="Cmdlets\Backup\BackupAzureRmRecoveryServicesItem.cs" />
8786
<Compile Include="Cmdlets\Item\EnableAzureRmRecoveryServicesProtection.cs" />
8887
<Compile Include="Cmdlets\Item\GetAzureRmRecoveryServicesItem.cs" />
8988
<Compile Include="Cmdlets\Jobs\GetAzureRmRecoveryServicesJob.cs" />
@@ -104,7 +103,9 @@
104103
<Compile Include="RecoveryServicesBackupCmdletBase.cs" />
105104
<Compile Include="CmdletParameterHelpMessages.cs" />
106105
</ItemGroup>
107-
<ItemGroup />
106+
<ItemGroup>
107+
<Folder Include="Cmdlets\Backup\" />
108+
</ItemGroup>
108109
<ItemGroup>
109110
<ProjectReference Include="..\..\Common\Commands.Common.Authentication\Commands.Common.Authentication.csproj">
110111
<Project>{d3804b64-c0d3-48f8-82ec-1f632f833c9e}</Project>

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Models/AzureVmModels/AzureRmRecoveryServicesAzureVmPolicy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class AzureRmRecoveryServicesIaasVmPolicy : AzureRmRecoveryServicesPolicy
2626

2727
public AzureRmRecoveryServicesRetentionPolicyBase RetentionPolicy { get; set; }
2828

29-
public virtual void Validate()
29+
public override void Validate()
3030
{
3131
base.Validate();
3232

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Models/CommonModels/PolicyRetentionObjects.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ public override string ToString()
295295
base.ToString(),
296296
RetentionScheduleDaily == null ? "NULL" : RetentionScheduleDaily.ToString(),
297297
RetentionScheduleWeekly == null ? "NULL" : RetentionScheduleWeekly.ToString(),
298-
MonthsOfYear.ToString(), base.ToString());
298+
TraceUtils.GetEnumsString<Month>(MonthsOfYear), base.ToString());
299299
}
300300
}
301301

@@ -365,7 +365,7 @@ public override string ToString()
365365
{
366366
return string.Format("DaysOfTheWeek:{0}, WeeksOfTheMonth:{1}",
367367
TraceUtils.GetString(DaysOfTheWeek),
368-
WeeksOfTheMonth.ToString());
368+
TraceUtils.GetEnumsString<WeekOfMonth>(WeeksOfTheMonth));
369369
}
370370
}
371371

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Models/CommonModels/Utils.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ public static string GetString(IEnumerable<Object> objList)
4747
return (objList == null) ? "null" : "{" + string.Join("}, {", objList) + "}";
4848
}
4949

50+
public static string GetEnumsString<T>(List<T> objList)
51+
{
52+
return (objList == null) ? "null" : "{" + string.Join(",", Enum.GetNames(typeof(T))) +"}";
53+
}
54+
5055
public static string GetString(IEnumerable<DateTime> objList)
5156
{
5257
return (objList == null) ? "null" : "{" + string.Join("}, {", objList) + "}";

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models;
1615
using System;
1716
using System.Collections.Generic;
1817
using System.Linq;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models;
1615
using System;
1716
using System.Collections.Generic;
1817
using System.Linq;

0 commit comments

Comments
 (0)