Fix LogicalSubnetworks IPConfiguration references

This commit is contained in:
Alexandru Coman 2017-02-14 15:45:46 +02:00
parent 0a901e394c
commit 5b2ffe68e1
No known key found for this signature in database
GPG Key ID: A7B6A9021F704507

View File

@ -515,8 +515,9 @@ class LogicalSubnetworks(_BaseHNVModel):
@classmethod
def from_raw_data(cls, raw_data):
"""Create a new model using raw API response."""
ip_pools = []
properties = raw_data["properties"]
ip_pools = []
for raw_content in properties.get("ipPools", []):
raw_content["parentResourceID"] = raw_data["resourceId"]
raw_content["grandParentResourceID"] = raw_data["parentResourceID"]
@ -524,10 +525,9 @@ class LogicalSubnetworks(_BaseHNVModel):
properties["ipPools"] = ip_pools
ip_configurations = []
raw_settings = properties.get("ipConfigurations", [])
for raw_configuration in raw_settings:
ip_configuration = IPConfiguration.from_raw_data(raw_configuration)
ip_configurations.append(ip_configuration)
for raw_content in properties.get("ipConfigurations", []):
resource = Resource.from_raw_data(raw_content)
ip_configurations.append(resource)
properties["ipConfigurations"] = ip_configurations
network_interfaces = []