Skip to content

Commit f15a12c

Browse files
committed
Merge pull request #57 from AzCiS/LAMigration
Migration cmdlet fixes
2 parents d22310a + d1e4425 commit f15a12c

8 files changed

+18
-11
lines changed

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Migration/ConfirmAzureStorSimpleLegacyVolumeContainerStatus.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public override void ExecuteCmdlet()
4646
confirmMigrationRequest.Operation =
4747
(MigrationOperation) Enum.Parse(typeof (MigrationOperation), MigrationOperation, true);
4848
confirmMigrationRequest.DataContainerNameList = (null != LegacyContainerNames)
49-
? new List<string>(LegacyContainerNames.ToList().Distinct())
49+
? new List<string>(LegacyContainerNames.ToList().Distinct(StringComparer.InvariantCultureIgnoreCase))
5050
: new List<string>();
5151
var status = StorSimpleClient.ConfirmLegacyVolumeContainerStatus(LegacyConfigId, confirmMigrationRequest);
5252
MigrationCommonModelFormatter opFormatter = new MigrationCommonModelFormatter();

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Migration/GetAzureStorSimpleLegacyVolumeContainerConfirmStatus.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ public override void ExecuteCmdlet()
4242
{
4343
var legacyContainerNameList = LegacyContainerNames.ToList();
4444
confirmStatus.ContainerConfirmStatus = confirmStatus.ContainerConfirmStatus.ToList().FindAll(
45-
status => legacyContainerNameList.Contains(status.CloudConfigurationName));
45+
status =>
46+
legacyContainerNameList.Contains(status.CloudConfigurationName,
47+
StringComparer.InvariantCultureIgnoreCase));
4648
}
4749
}
4850

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Migration/GetAzureStorSimpleLegacyVolumeContainerMigrationPlan.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public override void ExecuteCmdlet()
4141
var migrationPlanList = StorSimpleClient.GetAllMigrationPlan();
4242
if (migrationPlanList.MigrationPlans.Count == 0)
4343
{
44-
throw new ArgumentException(Resources.MigrationPlanNoConfigs);
44+
WriteWarning(Resources.MigrationPlanNoConfigs);
4545
}
4646
else
4747
{
@@ -68,7 +68,9 @@ public override void ExecuteCmdlet()
6868
var legacyContainerNamesList = LegacyContainerNames.ToList();
6969
migrationPlan.MigrationPlanInfo =
7070
migrationPlan.MigrationPlanInfo.ToList().FindAll(
71-
plan => legacyContainerNamesList.Contains(plan.DataContainerName));
71+
plan =>
72+
legacyContainerNamesList.Contains(plan.DataContainerName,
73+
StringComparer.InvariantCultureIgnoreCase));
7274
}
7375

7476
var migrationPlanMsg = new MigrationPlanMsg(migrationPlan);

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Migration/GetAzureStorSimpleLegacyVolumeContainerStatus.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@ public override void ExecuteCmdlet()
4141
overallMigrationStatusList.MigrationDataContainerStatuses.ToList();
4242
if (null != LegacyContainerNames && 0 < LegacyContainerNames.Length)
4343
{
44-
List<string> containerNameList = LegacyContainerNames.ToList();
44+
45+
var containerNameList = LegacyContainerNames.ToList();
4546
migrationDataContainerStatusList = migrationDataContainerStatusList.ToList().FindAll(
46-
status => containerNameList.Contains(status.CloudConfigurationName));
47+
status =>
48+
containerNameList.Contains(status.CloudConfigurationName,
49+
StringComparer.InvariantCultureIgnoreCase));
4750
}
4851

4952
var migrationStatus = new DataContainerMigrationStatus(

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Migration/ImportAzureStorSimpleLegacyVolumeContainer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public override void ExecuteCmdlet()
4646
{
4747
var importDataContainerRequest = new MigrationImportDataContainerRequest();
4848
importDataContainerRequest.DataContainerNames = (null != LegacyContainerNames)
49-
? new List<string>(LegacyContainerNames.ToList().Distinct())
49+
? new List<string>(LegacyContainerNames.ToList().Distinct(StringComparer.InvariantCultureIgnoreCase))
5050
: new List<string>();
5151
importDataContainerRequest.ForceOnOtherDevice = Force.IsPresent;
5252
importDataContainerRequest.SkipACRs = SkipACRs.IsPresent;

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Migration/StartAzureStorSimpleLegacyVolumeContainerMigrationPlan.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public override void ExecuteCmdlet()
4040
var startMigrationPlanRequest = new MigrationPlanStartRequest();
4141
startMigrationPlanRequest.ConfigId = LegacyConfigId;
4242
startMigrationPlanRequest.DataContainerNameList = (null != LegacyContainerNames)
43-
? new List<string>(LegacyContainerNames.ToList().Distinct())
43+
? new List<string>(LegacyContainerNames.ToList().Distinct(StringComparer.InvariantCultureIgnoreCase))
4444
: new List<string>();
4545

4646
var status = StorSimpleClient.StartLegacyVolumeContainerMigrationPlan(startMigrationPlanRequest);

src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/Resources.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/Resources.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ a special character</value>
566566
<value>Import started. You can check the import status with Get-AzureStorSimpleLegacyVolumeContainerStatus cmdlet.</value>
567567
</data>
568568
<data name="MigrationPlanNoConfigs" xml:space="preserve">
569-
<value>There are no configs on the resource.</value>
569+
<value>No ConfigFile imported.</value>
570570
</data>
571571
<data name="MigrationPlanNotFound" xml:space="preserve">
572572
<value>No migration plan found corresponding to the LegacyConfigId.</value>

0 commit comments

Comments
 (0)