Skip to content

Commit 479ae0d

Browse files
committed
Minor build break fixes
1 parent 11bfe48 commit 479ae0d

File tree

3 files changed

+13
-43
lines changed

3 files changed

+13
-43
lines changed

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Helpers/Validations/PolicyValidations.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,25 @@ private static void ValidateRetentionAndBackupTimes(List<DateTime> schPolicyTime
9494
}
9595
}
9696

97-
private static void ValidateRetentionAndScheduleDaysOfWeek(List<DayOfWeek> backupDOWList)
97+
private static void ValidateRetentionAndScheduleDaysOfWeek(List<DayOfWeek> schList, List<DayOfWeek> retList)
9898
{
9999
// TBD
100100

101101
/* if (backupDOWList.Count != DaysOfTheWeek.Count)
102102
{
103103
throw new ArgumentException("DaysOfTheWeek of retention schedule must be same of backup schedule DaysOfTheWeek");
104-
}
105-
foreach (var day in DaysOfTheWeek)
104+
} */
105+
106+
// each day in retList must be present in
107+
108+
/* foreach (var day in DaysOfTheWeek)
106109
{
107110
if (!backupDOWList.Contains(day))
108111
{
109112
throw new ArgumentException("DaysOfTheWeek of retention schedule must be same of backup schedule DaysOfTheWeek");
110113
}
111114
112-
} */
115+
}*/
113116
}
114117

115118
#endregion

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

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public class MonthlyRetentionSchedule : RetentionScheduleBase
196196
public MonthlyRetentionSchedule()
197197
: base()
198198
{
199-
this.RetentionScheduleFormatType = RetentionScheduleFormat.Invalid;
199+
200200
}
201201

202202
public override void Validate()
@@ -208,12 +208,7 @@ public override void Validate()
208208
throw new ArgumentException(string.Format("Allowed Count for DurationCountInMonths is 1 - {0}",
209209
PolicyConstants.MaxAllowedRetentionDurationCount));
210210
}
211-
212-
if (RetentionScheduleFormatType == RetentionScheduleFormat.Invalid)
213-
{
214-
throw new ArgumentException("RetentionScheduleType is set to Invalid");
215-
}
216-
211+
217212
if (RetentionScheduleFormatType == RetentionScheduleFormat.Daily)
218213
{
219214
if (RetentionScheduleDaily == null)
@@ -258,7 +253,7 @@ public class YearlyRetentionSchedule : RetentionScheduleBase
258253
public YearlyRetentionSchedule()
259254
: base()
260255
{
261-
this.RetentionScheduleFormatType = RetentionScheduleFormat.Invalid;
256+
262257
}
263258

264259
public override void Validate()
@@ -270,26 +265,12 @@ public override void Validate()
270265
throw new ArgumentException(string.Format("Allowed Count for DurationCountInYears is 1 - {0}",
271266
PolicyConstants.MaxAllowedRetentionDurationCount));
272267
}
273-
274-
if (RetentionScheduleFormatType == RetentionScheduleFormat.Invalid)
275-
{
276-
throw new ArgumentException("RetentionScheduleType is set to Invalid");
277-
}
278-
268+
279269
if (MonthsOfYear == null || MonthsOfYear.Count == 0)
280270
{
281271
throw new ArgumentException("MonthsOfYear is set to NULL/Empty");
282272
}
283-
284-
// validate if MonthsOfYear strings are correct
285-
foreach (Month month in MonthsOfYear)
286-
{
287-
if (month == Month.Invalid)
288-
{
289-
throw new ArgumentException("MonthsOfYear content is Invalid");
290-
}
291-
}
292-
273+
293274
if (RetentionScheduleFormatType == RetentionScheduleFormat.Daily)
294275
{
295276
if (RetentionScheduleDaily == null)
@@ -357,16 +338,7 @@ public void Validate()
357338
if (WeeksOfTheMonth == null || WeeksOfTheMonth.Count == 0)
358339
{
359340
throw new ArgumentException("WeeksOfTheMonth is set to NULL/Empty");
360-
}
361-
362-
// validate if WeeksOfTheMonth are valid
363-
foreach (WeekOfMonth week in WeeksOfTheMonth)
364-
{
365-
if (week == WeekOfMonth.Invalid)
366-
{
367-
throw new ArgumentException("WeeksOfTheMonth content is Invalid");
368-
}
369-
}
341+
}
370342
}
371343

372344
public override string ToString()

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ public class AzureRmRecoveryServicesSimpleSchedulePolicy : AzureRmRecoveryServic
3030

3131
public override void Validate()
3232
{
33-
if (ScheduleRunFrequency == ScheduleRunType.Invalid)
34-
{
35-
throw new ArgumentException("ScheduleRunFrequency is set to Invalid");
36-
}
37-
3833
//Currently only one scheduled run time is allowed
3934
if (ScheduleRunTimes == null || ScheduleRunTimes.Count != 1)
4035
{

0 commit comments

Comments
 (0)