فهرست منبع

GCP subnet default fix

almahmoud 7 سال پیش
والد
کامیت
134f41b212
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      cloudbridge/cloud/providers/gcp/services.py

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

@@ -1075,7 +1075,7 @@ class GCPSubnetService(BaseSubnetService):
         cidr_block = GCPSubnet.CB_DEFAULT_SUBNET_IPV4RANGE
         cidr_block = GCPSubnet.CB_DEFAULT_SUBNET_IPV4RANGE
         net = self.provider.networking.networks.get_or_create_default()
         net = self.provider.networking.networks.get_or_create_default()
         if net.subnets:
         if net.subnets:
-            max_sn = net.subnets[0]
+            max_sn = list(net.subnets)[0]
             # Find the maximum address subnet address space within the network
             # Find the maximum address subnet address space within the network
             for esn in net.subnets:
             for esn in net.subnets:
                 if (ipaddress.ip_network(esn.cidr_block) >
                 if (ipaddress.ip_network(esn.cidr_block) >