Skip to content

Commit 6ea34cc

Browse files
committed
fixed issue with virtual networking client - unable to update address range and add subnet if existing subnet doesn't exist - still small off-by-one bug need to fix but won't affect usability will just add 32 ips to the first address range if a subnet doesn't exist
1 parent 7c36581 commit 6ea34cc

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Elastacloud.AzureManagement.Fluent/Clients/VirtualNetworkClient.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ private string AddXmlSubnetToExistingNetworkingDefinition(SubnetTag tag)
165165
new XAttribute("name", tag.SubnetName),
166166
new XElement(Namespace + "AddressPrefix", tag.SubnetAddressRange)
167167
);
168+
if (virtualSites.Element(Namespace + "Subnets") == null)
169+
{
170+
virtualSites.Add(new XElement(Namespace + "Subnets"));
171+
}
168172
virtualSites.Element(Namespace + "Subnets").Add(addedSubnetTag);
169173
return document.ToStringFullXmlDeclaration();
170174
}

Elastacloud.FluentManagement.FSTest/VirtualMachines.fsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@ vmClient.CreateNewVirtualMachineDeploymentFromTemplateGallery(
6161
vmClient.LinuxVirtualMachineStatusEvent.Subscribe(fun vmstatus -> printfn "from %s to %s" (vmstatus.OldStatus.ToString()) (vmstatus.NewStatus.ToString()))
6262
// test 3: When created delete the subnet from the vnet - should generate a subnet busy exception of some sort
6363
let vnClient = VirtualNetworkClient(subscriptionId, (getFromBizsparkPlus subscriptionId))
64-
vnClient.RemoveSubnet("fsnet", "Subnet-3")
64+
vnClient.AddSubnetToAddressRange("bigbadbeetleborgs", "10.0.0.0/20", "max-1")
65+
vnClient.RemoveSubnet("bigbadbeetleborgs", "max-1")
6566
let images = vmClient.GetCurrentUbuntuImage()

0 commit comments

Comments
 (0)