Skip to content

Commit 92853e5

Browse files
author
dragonfly91
committed
Resolved merge conflicts
2 parents 23b733e + 6ea2093 commit 92853e5

File tree

7 files changed

+15
-14
lines changed

7 files changed

+15
-14
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public static ContainerType GetPsContainerType(string containerType)
150150
{
151151
return ContainerType.AzureVM;
152152
}
153-
else if (containerType == Microsoft.Azure.Management.RecoveryServices.Backup.Models.ContainerType.MABContainer.ToString())
153+
else if (containerType == Microsoft.Azure.Management.RecoveryServices.Backup.Models.ContainerType.Windows.ToString())
154154
{
155155
return ContainerType.Windows;
156156
}

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -439,15 +439,16 @@ public List<AzureRmRecoveryServicesBackupItemBase> ListProtectedItems()
439439
}
440440
} while (skipToken != null);
441441

442-
List<AzureRmRecoveryServicesBackupItemBase> itemModels = ConversionHelpers.GetItemModelList(protectedItems, container);
443-
444442
// 1. Filter by container
445-
itemModels = itemModels.Where(itemModel =>
443+
protectedItems = protectedItems.Where(protectedItem =>
446444
{
447-
// return itemModel.ContainerName == container.Name;
448-
return container.Name.Contains(itemModel.ContainerName);
445+
Dictionary<UriEnums, string> dictionary = HelperUtils.ParseUri(protectedItem.Id);
446+
string containerUri = HelperUtils.GetContainerUri(dictionary, protectedItem.Id);
447+
return containerUri.Contains(container.Name);
449448
}).ToList();
450449

450+
List<AzureRmRecoveryServicesBackupItemBase> itemModels = ConversionHelpers.GetItemModelList(protectedItems, container);
451+
451452
// 2. Filter by item's friendly name
452453
if (!string.IsNullOrEmpty(name))
453454
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public IPsBackupProvider GetProviderInstance(ContainerType containerType, Backup
5151
else if (backupManagementType == BackupManagementType.SCDPM)
5252
providerType = PsBackupProviderTypes.Dpm;
5353
else
54-
throw new ArgumentException(String.Format("BackupManagementType {0} is not expected for ContainerType {1}", backupManagementType, containerType));
54+
throw new ArgumentException(String.Format("BackupManagementType {0} is not expected for ContainerType {1}", backupManagementType.ToString(), containerType));
5555
break;
5656
//case ContainerType.AzureSqlContainer:
5757
// if (backupManagementType.HasValue)

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Test/ScenarioTests/IaasVm/ItemTests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function Test-EnableAzureVMProtectionScenario
2929
$vault = Get-AzureRmRecoveryServicesVault -ResourceGroupName "phaniktRSV" -Name "phaniktRs1";
3030
Set-AzureRmRecoveryServicesVaultContext -Vault $vault;
3131

32-
$policy = Get-AzureRmRecoveryServicesProtectionPolicy -Name "pwtest1"
32+
$policy = Get-AzureRmRecoveryServicesBackupProtectionPolicy -Name "pwtest1"
3333

3434
$job = Enable-AzureRmRecoveryServicesBackupProtection -Name "mylinux1" -ResourceGroupName "mylinux1" -WorkloadType "AzureVM" -Policy $policy;
3535
Assert-AreEqual $job.Status "Completed";
@@ -56,7 +56,7 @@ function Test-GetAzureVMRecoveryPointsScenario
5656
$vault = Get-AzureRmRecoveryServicesVault -ResourceGroupName "phaniktRSV" -Name "phaniktRs1";
5757
Set-AzureRmRecoveryServicesVaultContext -Vault $vault;
5858

59-
$namedContainer = Get-AzureRmRecoveryServicesContainer -ContainerType "AzureVM" -Status "Registered" -Name "mylinux1";
59+
$namedContainer = Get-AzureRmRecoveryServicesBackupContainer -ContainerType "AzureVM" -Status "Registered" -Name "mylinux1";
6060
Assert-AreEqual $namedContainer.FriendlyName "mylinux1";
6161

6262
$item = Get-AzureRmRecoveryServicesBackupItem -Container $namedContainer -WorkloadType "AzureVM";
@@ -72,7 +72,7 @@ function Test-RestoreAzureVMRItemScenario
7272
$vault = Get-AzureRmRecoveryServicesVault -ResourceGroupName "phaniktRSV" -Name "phaniktRs1";
7373
Set-AzureRmRecoveryServicesVaultContext -Vault $vault;
7474

75-
$namedContainer = Get-AzureRmRecoveryServicesContainer -ContainerType "AzureVM" -Status "Registered" -Name "mylinux1";
75+
$namedContainer = Get-AzureRmRecoveryServicesBackupContainer -ContainerType "AzureVM" -Status "Registered" -Name "mylinux1";
7676
Assert-AreEqual $namedContainer.FriendlyName "mylinux1";
7777

7878
$item = Get-AzureRmRecoveryServicesBackupItem -Container $namedContainer -WorkloadType "AzureVM";
@@ -90,7 +90,7 @@ function Test-BackupItemScenario
9090
$vault = Get-AzureRmRecoveryServicesVault -ResourceGroupName "pstestrg" -Name "pstestrsvault";
9191
Set-AzureRmRecoveryServicesVaultContext -Vault $vault;
9292

93-
$namedContainer = Get-AzureRmRecoveryServicesContainer -ContainerType "AzureVM" -Status "Registered" -Name "pstestv2vm1";
93+
$namedContainer = Get-AzureRmRecoveryServicesBackupContainer -ContainerType "AzureVM" -Status "Registered" -Name "pstestv2vm1";
9494
Assert-AreEqual $namedContainer.FriendlyName "pstestv2vm1";
9595

9696
$item = Get-AzureRmRecoveryServicesBackupItem -Container $namedContainer -WorkloadType "AzureVM";

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Test/ScenarioTests/IaasVm/JobTests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ function Test-GetJobDetails
110110
$jobs = Get-AzureRmRecoveryServicesBackupJob -From $fixedStartDate -To $fixedEndDate
111111
foreach ($job in $jobs)
112112
{
113-
$jobDetails = Get-AzureRmRecoveryServicesBackupJob -Job $job;
114-
$jobDetails2 = Get-AzureRmRecoveryServicesBackupJob -JobId $job.InstanceId
113+
$jobDetails = Get-AzureRmRecoveryServicesBackupJobDetails -Job $job;
114+
$jobDetails2 = Get-AzureRmRecoveryServicesBackupJobDetails -JobId $job.InstanceId
115115

116116
Assert-AreEqual $jobDetails.InstanceId $job.InstanceId
117117
Assert-AreEqual $jobDetails2.InstanceId $job.InstanceId

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2020
{
21-
[Cmdlet(VerbsCommon.Get, "AzureRmRecoveryServicesBackupJob", DefaultParameterSetName = JobFilterSet), OutputType(typeof(AzureRmRecoveryServicesJobBase))]
21+
[Cmdlet(VerbsCommon.Get, "AzureRmRecoveryServicesBackupJobDetails", DefaultParameterSetName = JobFilterSet), OutputType(typeof(AzureRmRecoveryServicesJobBase))]
2222
public class GetAzureRmRecoveryServicesJobDetails : RecoveryServicesBackupCmdletBase
2323
{
2424
protected const string IdFilterSet = "IdFilterSet";

0 commit comments

Comments
 (0)