Skip to content

Commit f5fdc47

Browse files
committed
Updating for release branch
1 parent 6e9eb4f commit f5fdc47

File tree

8 files changed

+40
-122
lines changed

8 files changed

+40
-122
lines changed

src/ResourceManager/Dns/Commands.Dns.Test/Commands.Dns.Test.csproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252
<SpecificVersion>False</SpecificVersion>
5353
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
5454
</Reference>
55+
<Reference Include="Microsoft.Azure.Gallery, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
56+
<SpecificVersion>False</SpecificVersion>
57+
<HintPath>..\..\..\packages\Microsoft.Azure.Gallery.2.6.2-preview\lib\net40\Microsoft.Azure.Gallery.dll</HintPath>
58+
</Reference>
5559
<Reference Include="Microsoft.Azure.Management.Authorization, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
5660
<SpecificVersion>False</SpecificVersion>
5761
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
@@ -73,7 +77,7 @@
7377
</Reference>
7478
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7579
<SpecificVersion>False</SpecificVersion>
76-
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5945.28173-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
80+
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.6.3-preview\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
7781
<Private>True</Private>
7882
</Reference>
7983
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.27.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -100,7 +104,7 @@
100104
<Private>True</Private>
101105
</Reference>
102106
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
103-
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.2.0-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
107+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.2.6-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
104108
<Private>True</Private>
105109
</Reference>
106110
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -177,8 +181,6 @@
177181
<Compile Include="ScenarioTests\ZoneTests.cs" />
178182
<Compile Include="ScenarioTests\RecordsTests.cs" />
179183
<Compile Include="ScenarioTests\DnsTestsBase.cs" />
180-
<Compile Include="UnitTests\GetAzureDnsRecordSetTests.cs" />
181-
<Compile Include="UnitTests\GetAzureDnsZoneTests.cs" />
182184
</ItemGroup>
183185
<ItemGroup>
184186
<ProjectReference Include="..\..\..\Common\Commands.Common.Authentication\Commands.Common.Authentication.csproj">

src/ResourceManager/Dns/Commands.Dns.Test/UnitTests/GetAzureDnsRecordSetTests.cs

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/ResourceManager/Dns/Commands.Dns.Test/UnitTests/GetAzureDnsZoneTests.cs

Lines changed: 0 additions & 42 deletions
This file was deleted.

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,22 @@
22
<packages>
33
<package id="Hyak.Common" version="1.0.3" targetFramework="net45" />
44
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
5+
<package id="Microsoft.Azure.Gallery" version="2.6.2-preview" targetFramework="net45" />
56
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
7+
<package id="Microsoft.Azure.Test.Framework" version="1.0.5945.28173-prerelease" targetFramework="net45" />
68
<package id="Microsoft.Azure.Management.Authorization" version="2.0.0" targetFramework="net45" />
79
<package id="Microsoft.Azure.Management.Dns" version="1.7.2-preview" targetFramework="net45" />
810
<package id="Microsoft.Azure.Management.ResourceManager" version="1.1.1-preview" targetFramework="net45" />
911
<package id="Microsoft.Azure.Management.Resources" version="2.20.0-preview" targetFramework="net45" />
10-
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.0.5945.28173-prerelease" targetFramework="net45" />
12+
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.6.3-preview" targetFramework="net45" />
1113
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
1214
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
1315
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" />
1416
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.27.306291202" targetFramework="net45" />
1517
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
1618
<package id="Microsoft.Rest.ClientRuntime" version="2.3.1" targetFramework="net45" />
1719
<package id="Microsoft.Rest.ClientRuntime.Azure" version="3.1.0" targetFramework="net45" />
20+
<package id="Microsoft.Rest.ClientRuntime.Azure.TestFramework" version="1.2.6-preview" targetFramework="net45" />
1821
<package id="Microsoft.Rest.ClientRuntime.Azure.Authentication" version="2.2.4-preview" targetFramework="net45" />
1922
<package id="Moq" version="4.2.1510.2205" targetFramework="net45" />
2023
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />

src/ResourceManager/Dns/Commands.Dns/Commands.Dns.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@
136136
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.1.0\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
137137
<Private>True</Private>
138138
</Reference>
139+
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
140+
<SpecificVersion>False</SpecificVersion>
141+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.1.0\lib\net45\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
142+
</Reference>
139143
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
140144
<SpecificVersion>False</SpecificVersion>
141145
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.2.4-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll</HintPath>

src/ResourceManager/Dns/Commands.Dns/Models/DnsClient.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,24 @@ public List<DnsRecordSet> ListRecordSets(string zoneName, string resourceGroupNa
386386
return results;
387387
}
388388

389+
public DnsZone GetDnsZoneHandleNonExistentZone(string zoneName, string resourceGroupName)
390+
{
391+
DnsZone retrievedZone = null;
392+
try
393+
{
394+
retrievedZone = this.GetDnsZone(zoneName, resourceGroupName);
395+
}
396+
catch (CloudException exception)
397+
{
398+
if (exception.Body.Code != "ResourceNotFound")
399+
{
400+
throw;
401+
}
402+
}
403+
404+
return retrievedZone;
405+
}
406+
389407
private static DnsRecordSet GetPowerShellRecordSet(string zoneName, string resourceGroupName, Management.Dns.Models.RecordSet mamlRecordSet)
390408
{
391409
// e.g. "/subscriptions/<guid>/resourceGroups/<rg>/providers/microsoft.dns/dnszones/<zone>/A/<recordset>"

src/ResourceManager/Dns/Commands.Dns/Zones/RemoveAzureDnsZone.cs

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,15 @@ public override void ExecuteCmdlet()
5454
bool deleted = true;
5555
bool overwrite = this.Overwrite.IsPresent || this.ParameterSetName != "Object";
5656

57+
if (!string.IsNullOrEmpty(this.Name) && this.Name.EndsWith("."))
58+
{
59+
this.Name = this.Name.TrimEnd('.');
60+
this.WriteWarning(string.Format("Modifying zone name to remove terminating '.'. Zone name used is \"{0}\".", this.Name));
61+
}
62+
5763
// There is a bug in sdk where it doesn't handle non existing zones on delete. Hence, handling the condition in powershell
5864
var zoneToDelete = (this.ParameterSetName != "Object")
59-
? GetDnsZoneHandleNonExistentZone(this.Name, this.ResourceGroupName)
65+
? this.DnsClient.GetDnsZoneHandleNonExistentZone(this.Name, this.ResourceGroupName)
6066
: this.Zone;
6167

6268
if (zoneToDelete != null)
@@ -99,29 +105,5 @@ public override void ExecuteCmdlet()
99105
});
100106
}
101107
}
102-
103-
public DnsZone GetDnsZoneHandleNonExistentZone(string zoneName, string resourceGroupName)
104-
{
105-
DnsZone retrievedZone = null;
106-
try
107-
{
108-
if (zoneName.EndsWith("."))
109-
{
110-
zoneName = zoneName.TrimEnd('.');
111-
this.WriteWarning(string.Format("Modifying zone name to remove terminating '.'. Zone name used is \"{0}\".", zoneName));
112-
}
113-
114-
retrievedZone = this.DnsClient.GetDnsZone(zoneName, resourceGroupName);
115-
}
116-
catch (CloudException exception)
117-
{
118-
if (exception.Body.Code != "ResourceNotFound")
119-
{
120-
throw;
121-
}
122-
}
123-
124-
return retrievedZone;
125-
}
126108
}
127109
}

src/ResourceManager/Dns/Commands.Dns/packages.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.27.306291202" targetFramework="net45" />
1616
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
1717
<package id="Microsoft.Rest.ClientRuntime" version="2.1.0" targetFramework="net45" />
18+
<package id="Microsoft.Rest.ClientRuntime.Azure" version="3.1.0" targetFramework="net45" />
1819
<package id="Microsoft.Rest.ClientRuntime.Azure.Authentication" version="2.2.4-preview" targetFramework="net45" />
1920
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
2021
<package id="System.Spatial" version="5.6.4" targetFramework="net45" />

0 commit comments

Comments
 (0)