Skip to content

Commit f79d121

Browse files
author
Samuel Anudeep
committed
Merge pull request #159 from MabOneSdk/dev1-anudeeb
Fix for Bug 4751044. Signed off by SureshT and Vsarg.
2 parents 4b4ffae + 3b10c32 commit f79d121

File tree

9 files changed

+41
-27
lines changed

9 files changed

+41
-27
lines changed

src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/Commands.AzureBackup.Test.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
<Private>True</Private>
4141
</Reference>
4242
<Reference Include="Microsoft.Azure.Management.BackupServicesManagement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
43-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.BackupServices.1.0.4-preview\lib\net40\Microsoft.Azure.Management.BackupServicesManagement.dll</HintPath>
43+
<SpecificVersion>False</SpecificVersion>
44+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.BackupServices.1.0.5-preview\lib\net40\Microsoft.Azure.Management.BackupServicesManagement.dll</HintPath>
4445
</Reference>
4546
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
4647
<SpecificVersion>False</SpecificVersion>

src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
55
<package id="Microsoft.Azure.Common.Authentication" version="1.3.1-preview" targetFramework="net45" />
66
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
7-
<package id="Microsoft.Azure.Management.BackupServices" version="1.0.4-preview" targetFramework="net45" />
7+
<package id="Microsoft.Azure.Management.BackupServices" version="1.0.5-preview" targetFramework="net45" />
88
<package id="Microsoft.Azure.Management.Resources" version="2.18.7-preview" targetFramework="net45" />
99
<package id="Microsoft.Azure.Test.Framework" version="1.0.5715.36130-prerelease" targetFramework="net45" />
1010
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.0.5715.36130-prerelease" targetFramework="net45" />

src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/EnableAzureRMBackupContainerReregistration.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ protected override void ProcessRecord()
4646
{
4747
case AzureBackupContainerType.Windows:
4848
case AzureBackupContainerType.SCDPM:
49+
case AzureBackupContainerType.AzureBackupServer:
50+
case AzureBackupContainerType.Other:
4951
AzureBackupClient.EnableMachineContainerReregistration(Container.ResourceGroupName, Container.ResourceName, Container.Id);
5052
break;
5153
default:

src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/GetAzureRMBackupContainer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ protected override void ProcessRecord()
6060
{
6161
case AzureBackupContainerType.Windows:
6262
case AzureBackupContainerType.SCDPM:
63+
case AzureBackupContainerType.AzureBackupServer:
64+
case AzureBackupContainerType.Other:
6365
containers.AddRange(GetMachineContainers(Vault.ResourceGroupName, Vault.Name));
6466
break;
6567
case AzureBackupContainerType.AzureVM:

src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/UnregisterAzureRMBackupContainer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ protected override void ProcessRecord()
4747
{
4848
case AzureBackupContainerType.Windows:
4949
case AzureBackupContainerType.SCDPM:
50+
case AzureBackupContainerType.AzureBackupServer:
51+
case AzureBackupContainerType.Other:
5052
DeleteServer();
5153
break;
5254
case AzureBackupContainerType.AzureVM:

src/ResourceManager/AzureBackup/Commands.AzureBackup/Commands.AzureBackup.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
5858
</Reference>
5959
<Reference Include="Microsoft.Azure.Management.BackupServicesManagement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
60-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.BackupServices.1.0.4-preview\lib\net40\Microsoft.Azure.Management.BackupServicesManagement.dll</HintPath>
60+
<SpecificVersion>False</SpecificVersion>
61+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.BackupServices.1.0.5-preview\lib\net40\Microsoft.Azure.Management.BackupServicesManagement.dll</HintPath>
6162
</Reference>
6263
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6364
<SpecificVersion>False</SpecificVersion>

src/ResourceManager/AzureBackup/Commands.AzureBackup/Helpers/ContainerHelpers.cs

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,33 +38,37 @@ internal class ContainerHelpers
3838
{
3939
private static readonly Regex ResourceGroupRegex = new Regex(@"/subscriptions/(?<subscriptionsId>.+)/resourceGroups/(?<resourceGroupName>.+)/providers/(?<providersName>.+)/BackupVault/(?<BackupVaultName>.+)/containers/(?<containersName>.+)", RegexOptions.Compiled);
4040

41-
internal static AzureBackupContainerType GetContainerType(string customerType)
41+
internal static AzureBackupContainerType GetContainerType(string customerTypeString)
4242
{
43-
CustomerType type = (CustomerType)Enum.Parse(typeof(CustomerType), customerType);
44-
4543
AzureBackupContainerType containerType = 0;
44+
CustomerType customerType = CustomerType.Invalid;
4645

47-
switch (type)
46+
if (Enum.TryParse<CustomerType>(customerTypeString, out customerType))
4847
{
49-
case CustomerType.DPM:
50-
containerType = AzureBackupContainerType.SCDPM;
51-
break;
52-
case CustomerType.InMage:
53-
break;
54-
case CustomerType.Invalid:
55-
break;
56-
case CustomerType.ManagedContainer:
57-
break;
58-
case CustomerType.OBS:
59-
containerType = AzureBackupContainerType.Windows;
60-
break;
61-
case CustomerType.SBS:
62-
containerType = AzureBackupContainerType.Windows;
63-
break;
64-
case CustomerType.SqlPaaS:
65-
break;
66-
default:
67-
break;
48+
switch (customerType)
49+
{
50+
case CustomerType.DPM:
51+
containerType = AzureBackupContainerType.SCDPM;
52+
break;
53+
case CustomerType.OBS:
54+
containerType = AzureBackupContainerType.Windows;
55+
break;
56+
case CustomerType.SBS:
57+
containerType = AzureBackupContainerType.Windows;
58+
break;
59+
case CustomerType.DPMVenus:
60+
containerType = AzureBackupContainerType.AzureBackupServer;
61+
break;
62+
case CustomerType.Invalid:
63+
break;
64+
default:
65+
containerType = AzureBackupContainerType.Other;
66+
break;
67+
}
68+
}
69+
else if (!string.IsNullOrEmpty(customerTypeString))
70+
{
71+
containerType = AzureBackupContainerType.Other;
6872
}
6973

7074
return containerType;

src/ResourceManager/AzureBackup/Commands.AzureBackup/Models/AzureBackupEnums.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ public enum AzureBackupContainerType
2525
Windows = 1,
2626
SCDPM,
2727
AzureVM,
28+
AzureBackupServer,
29+
Other,
2830
}
2931

3032
public enum DataSourceType

src/ResourceManager/AzureBackup/Commands.AzureBackup/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
55
<package id="Microsoft.Azure.Common.Authentication" version="1.3.1-preview" targetFramework="net45" />
66
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
7-
<package id="Microsoft.Azure.Management.BackupServices" version="1.0.4-preview" targetFramework="net45" />
7+
<package id="Microsoft.Azure.Management.BackupServices" version="1.0.5-preview" targetFramework="net45" />
88
<package id="Microsoft.Azure.Management.Resources" version="2.18.7-preview" targetFramework="net45" />
99
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
1010
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />

0 commit comments

Comments
 (0)