From f89dd94cec76cdb352fb4155e92f09d287c91eb6 Mon Sep 17 00:00:00 2001 From: Hoai-Thu Vuong Date: Wed, 23 Jun 2021 12:03:07 +0700 Subject: [PATCH] extract ipaddresses from multiple subnet participation --- pyvcloud/vcd/gateway.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyvcloud/vcd/gateway.py b/pyvcloud/vcd/gateway.py index 5ef75cb7..7fad4ab1 100644 --- a/pyvcloud/vcd/gateway.py +++ b/pyvcloud/vcd/gateway.py @@ -201,7 +201,9 @@ def list_external_network_ip_allocations(self): for inf in gateway.Configuration.GatewayInterfaces.GatewayInterface: if inf.InterfaceType.text == 'uplink': ips = out.setdefault(inf.Name.text, []) - ips.append(inf.SubnetParticipation.IpAddress.text) + for subnet_participation in inf.SubnetParticipation: + if hasattr(subnet_participation, 'IpAddress'): + ips.append(subnet_participation.IpAddress.text) return out def redeploy(self):