-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Ignite ReservedIP/Multivip fixes for powershell with tests #577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
aac87f9
067490e
f421813
ca5afb8
8b8eded
e388ee0
76ef2e3
c3f13f1
bf5e9c1
2e2b4ba
ffb5945
499e33a
5d01339
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,9 +26,17 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS | |
| [Cmdlet(VerbsCommon.New, ReservedIPConstants.CmdletNoun, DefaultParameterSetName = ReserveNewIPParamSet), OutputType(typeof(ManagementOperationContext))] | ||
| public class NewAzureReservedIPCmdlet : ServiceManagementBaseCmdlet | ||
| { | ||
| protected const string ReserveNewIPParamSet = "CreateNewReservedIP"; | ||
| protected const string ReserveInUseIPUsingSlotParamSet = "CreateInUseReservedIPUsingSlot"; | ||
| protected const string ReserveInUseIPParamSet = "CreateInUseReservedIP"; | ||
| public const string ReserveNewIPParamSet = "CreateNewReservedIP"; | ||
| public const string ReserveInUseIPUsingSlotParamSet = "CreateInUseReservedIPUsingSlot"; | ||
| public const string ReserveInUseIPParamSet = "CreateInUseReservedIP"; | ||
|
|
||
| public NewAzureReservedIPCmdlet() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we remove these empty constructors?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a parameterized constructor, so default constructor is required to support backward compatibility. |
||
| { | ||
| } | ||
|
|
||
| public NewAzureReservedIPCmdlet(IClientProvider provider) : base(provider) | ||
| { | ||
| } | ||
|
|
||
| [Parameter(Mandatory = true, Position = 0, ValueFromPipelineByPropertyName = true, ParameterSetName = ReserveNewIPParamSet, HelpMessage = "Reserved IP Name.")] | ||
| [Parameter(Mandatory = true, Position = 0, ValueFromPipelineByPropertyName = true, ParameterSetName = ReserveInUseIPUsingSlotParamSet, HelpMessage = "Reserved IP Name.")] | ||
|
|
@@ -85,7 +93,7 @@ public string Slot | |
| set; | ||
| } | ||
|
|
||
| protected override void OnProcessRecord() | ||
| public override void ExecuteCmdlet() | ||
| { | ||
| ServiceManagementProfile.Initialize(); | ||
| string deploymentName = string.Empty; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,15 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS | |
| [Cmdlet(VerbsCommon.Remove, ReservedIPConstants.CmdletNoun, DefaultParameterSetName = RemoveReservedIPParamSet), OutputType(typeof(ManagementOperationContext))] | ||
| public class RemoveAzureReservedIPCmdlet : ServiceManagementBaseCmdlet | ||
| { | ||
| public RemoveAzureReservedIPCmdlet() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we remove these empty constructors?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a parameterized constructor, so default constructor is required to support backward compatibility. |
||
| { | ||
| } | ||
|
|
||
| public RemoveAzureReservedIPCmdlet(IClientProvider provider) | ||
| : base(provider) | ||
| { | ||
| } | ||
|
|
||
| protected const string RemoveReservedIPParamSet = "RemoveReservedIP"; | ||
|
|
||
| [Parameter(Mandatory = true, Position = 0, ValueFromPipelineByPropertyName = true, HelpMessage = "Reserved IP Name.")] | ||
|
|
@@ -32,7 +41,7 @@ public class RemoveAzureReservedIPCmdlet : ServiceManagementBaseCmdlet | |
| [Parameter(Position = 1, HelpMessage = "Do not confirm deletion of deployment")] | ||
| public SwitchParameter Force { get; set; } | ||
|
|
||
| protected override void OnProcessRecord() | ||
| public override void ExecuteCmdlet() | ||
| { | ||
| ServiceManagementProfile.Initialize(); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,8 +99,11 @@ | |
| <HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.12.2.0-preview\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath> | ||
| </Reference> | ||
| <Reference Include="Microsoft.WindowsAzure.Management.Network"> | ||
| <HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Network.7.0.3\lib\net40\Microsoft.WindowsAzure.Management.Network.dll</HintPath> | ||
| </Reference> | ||
| <Reference Include="Microsoft.WindowsAzure.Management.Storage, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
| <SpecificVersion>False</SpecificVersion> | ||
| <HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Network.7.0.2\lib\net40\Microsoft.WindowsAzure.Management.Network.dll</HintPath> | ||
| <HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Storage.5.1.1\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll</HintPath> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it expected to update Storage to
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. I'll remove the update. However other files seem to contain 5.1.1
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is adding a new Storage dependency. This project never had storage dependency. The diff appears against the network package because its confused. All other projects seem to refer to 5.1.1.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Eg. Commands.ServiceManagement.Preview |
||
| </Reference> | ||
| <Reference Include="Moq, Version=4.2.1402.2112, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL"> | ||
| <SpecificVersion>False</SpecificVersion> | ||
|
|
@@ -145,10 +148,12 @@ | |
| <ItemGroup> | ||
| <Compile Include="IPForwarding\GetIPForwardingTests.cs" /> | ||
| <Compile Include="IPForwarding\SetIPForwardingTests.cs" /> | ||
| <Compile Include="Multivip\MultivipTests.cs" /> | ||
| <Compile Include="NetworkSecurityGroups\GetNetworkSecurityGroupAssociationTests.cs" /> | ||
| <Compile Include="NetworkSecurityGroups\RemoveNetworkSecurityGroupAssociationTests.cs" /> | ||
| <Compile Include="NetworkSecurityGroups\SetNetworkSecurityGroupAssociationTests.cs" /> | ||
| <Compile Include="Properties\AssemblyInfo.cs" /> | ||
| <Compile Include="ReservedIP\ReservedIPTest.cs" /> | ||
| <Compile Include="Routes\GetEffectiveRouteTests.cs" /> | ||
| <Compile Include="Routes\GetRouteTableTests.cs" /> | ||
| <Compile Include="Routes\GetSubnetRouteTableTests.cs" /> | ||
|
|
@@ -159,16 +164,22 @@ | |
| <Compile Include="Routes\SetRouteTests.cs" /> | ||
| <Compile Include="Routes\SetSubnetRouteTableTests.cs" /> | ||
| <Compile Include="ScenarioTests\IPForwarding\IPForwardingScenarioTests.cs" /> | ||
| <Compile Include="ScenarioTests\MultiVip\MultiVip.cs" /> | ||
| <Compile Include="ScenarioTests\NetworkSecurityGroup\NSGScenarioTests.cs" /> | ||
| <Compile Include="ScenarioTests\NetworkTests.cs" /> | ||
| <Compile Include="ScenarioTests\NetworkTestsBase.cs" /> | ||
| <Compile Include="ScenarioTests\ReservedIPs\ReservedIP.cs" /> | ||
| <Compile Include="TestInterfaces\TestClientProvider.cs" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <None Include="MSSharedLibKey.snk" /> | ||
| <None Include="packages.config" /> | ||
| <None Include="ScenarioTests\IPForwarding\IPForwardingTests.ps1"> | ||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
| </None> | ||
| <None Include="ScenarioTests\MultiVip\MultiVipTests.ps1"> | ||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
| </None> | ||
| <None Include="ScenarioTests\NetworkSecurityGroup\Common.ps1"> | ||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
| </None> | ||
|
|
@@ -187,6 +198,10 @@ | |
| <Project>{5ee72c53-1720-4309-b54b-5fb79703195f}</Project> | ||
| <Name>Commands.Common</Name> | ||
| </ProjectReference> | ||
| <ProjectReference Include="..\..\..\Common\Commands.Profile\Commands.Profile.csproj"> | ||
| <Project>{c60342b1-47d3-4a0e-8081-9b97ce60b7af}</Project> | ||
| <Name>Commands.Profile</Name> | ||
| </ProjectReference> | ||
| <ProjectReference Include="..\..\..\Common\Commands.ScenarioTests.Common\Commands.ScenarioTests.Common.csproj"> | ||
| <Project>{C1BDA476-A5CC-4394-914D-48B0EC31A710}</Project> | ||
| <Name>Commands.ScenarioTests.Common</Name> | ||
|
|
@@ -203,12 +218,31 @@ | |
| <Project>{E1CA72BA-8374-45F6-904D-FD34ECDF5B6F}</Project> | ||
| <Name>Commands.ServiceManagement</Name> | ||
| </ProjectReference> | ||
| <ProjectReference Include="..\..\Services\Commands.Utilities\Commands.Utilities.csproj"> | ||
| <Project>{4900ec4e-8deb-4412-9108-0bc52f81d457}</Project> | ||
| <Name>Commands.Utilities</Name> | ||
| </ProjectReference> | ||
| <ProjectReference Include="..\Commands.Network\Commands.ServiceManagement.Network.csproj"> | ||
| <Project>{40fee0bb-fd45-4efc-85bc-0d602a6892c4}</Project> | ||
| <Name>Commands.ServiceManagement.Network</Name> | ||
| </ProjectReference> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <None Include="ScenarioTests\ReservedIPs\ReservedIPTests.ps1"> | ||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
| </None> | ||
| <None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.ScenarioTests.MultiVip\ExtraVipLifecycle.json"> | ||
| <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
| </None> | ||
| <None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.ScenarioTests.MultiVip\ExtraVipMobility.json"> | ||
| <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
| </None> | ||
| <None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.ScenarioTests.MultiVip\ReserveMultivipDepIP.json"> | ||
| <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
| </None> | ||
| <None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.ScenarioTests.MultiVip\SetLbEpMultivipDep.json"> | ||
| <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
| </None> | ||
| <None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.ScenarioTests.NSGScenarioTests\CreateAndRemoveNSG.json"> | ||
| <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
| </None> | ||
|
|
@@ -236,6 +270,21 @@ | |
| <None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.ScenarioTests.NSGScenarioTests\SetNSRWithInvalidParameter.json"> | ||
| <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
| </None> | ||
| <None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.ScenarioTests.ReservedIP\AzureReservedIPSimpleOps.json"> | ||
| <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
| </None> | ||
| <None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.ScenarioTests.ReservedIP\CreateVMWithReservedIP.json"> | ||
| <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
| </None> | ||
| <None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.ScenarioTests.ReservedIP\RemoveReservedIPAssocSimple.json"> | ||
| <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
| </None> | ||
| <None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.ScenarioTests.ReservedIP\ReserveExistingDepIP.json"> | ||
| <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
| </None> | ||
| <None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.ScenarioTests.ReservedIP\SetReservedIPAssocSimple.json"> | ||
| <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
| </None> | ||
| <None Include="TestData\EmptyNetworkConfiguration.xml"> | ||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
| </None> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove these empty constructors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a parameterized constructor, so default constructor is required to support backward compatibility.