Jelajahi Sumber

GCP default subnet fix

almahmoud 7 tahun lalu
induk
melakukan
2b9f7dd32e
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      cloudbridge/providers/gcp/services.py

+ 1 - 1
cloudbridge/providers/gcp/services.py

@@ -1053,7 +1053,7 @@ class GCPSubnetService(BaseSubnetService):
         # does the calculations (e.g., 10.0.0.0/24, 10.0.1.0/24).
         cidr_block = GCPSubnet.CB_DEFAULT_SUBNET_IPV4RANGE
         net = self.provider.networking.networks.get_or_create_default()
-        if net.subnets:
+        if net.subnets and len(list(net.subnets)) > 0:
             max_sn = list(net.subnets)[0]
             # Find the maximum address subnet address space within the network
             for esn in net.subnets: