فهرست منبع

Minor lint fixes

Ehsan Chiniforooshan 8 سال پیش
والد
کامیت
67a39c3764
2فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 0 1
      cloudbridge/cloud/providers/gce/helpers.py
  2. 3 1
      cloudbridge/cloud/providers/gce/services.py

+ 0 - 1
cloudbridge/cloud/providers/gce/helpers.py

@@ -1,5 +1,4 @@
 # based on http://stackoverflow.com/a/39126754
-import cloudbridge as cb
 from cryptography.hazmat.backends import default_backend
 from cryptography.hazmat.primitives import serialization as crypt_serialization
 from cryptography.hazmat.primitives.asymmetric import rsa

+ 3 - 1
cloudbridge/cloud/providers/gce/services.py

@@ -762,7 +762,9 @@ class GCESubnetService(BaseSubnetService):
                               maxResults=max_result,
                               pageToken=marker)
                         .execute())
-        subnets = [GCESubnet(self.provider, item) for item in response['items']]
+        subnets = []
+        for subnet in response.get('items', []):
+            subnets.append(GCESubnet(self.provider, subnet))
         if len(subnets) > max_result:
             cb.log.warning('Expected at most %d results; got %d',
                            max_result, len(subnets))