浏览代码

(GCP) Fix check for default subnets

Enis Afgan 7 年之前
父节点
当前提交
1691857e60
共有 1 个文件被更改,包括 1 次插入1 次删除
  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).
         # does the calculations (e.g., 10.0.0.0/24, 10.0.1.0/24).
         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 list(net.subnets):
             max_sn = list(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: