Jelajahi Sumber

Fix linting errors

Nuwan Goonasekera 3 tahun lalu
induk
melakukan
ee9c2b9d97

+ 4 - 4
cloudbridge/base/resources.py

@@ -112,8 +112,8 @@ class BaseCloudResource(CloudResource):
 
     def to_json(self):
         # Get all attributes but filter methods and private/magic ones
-        attr = inspect.getmembers(self, lambda a: not(inspect.isroutine(a)))
-        js = {k: v for(k, v) in attr if not k.startswith('_')}
+        attr = inspect.getmembers(self, lambda a: not (inspect.isroutine(a)))
+        js = {k: v for (k, v) in attr if not k.startswith('_')}
         return js
 
     def __repr__(self):
@@ -672,8 +672,8 @@ class BaseRegion(BaseCloudResource, Region):
                 self.id == other.id)
 
     def to_json(self):
-        attr = inspect.getmembers(self, lambda a: not(inspect.isroutine(a)))
-        js = {k: v for(k, v) in attr if not k.startswith('_')}
+        attr = inspect.getmembers(self, lambda a: not (inspect.isroutine(a)))
+        js = {k: v for (k, v) in attr if not k.startswith('_')}
         js['zones'] = [z.id for z in self.zones]
         return js
 

+ 2 - 2
cloudbridge/providers/gcp/resources.py

@@ -532,8 +532,8 @@ class GCPVMFirewall(BaseVMFirewall):
         return self._rule_container
 
     def to_json(self):
-        attr = inspect.getmembers(self, lambda a: not(inspect.isroutine(a)))
-        js = {k: v for(k, v) in attr if not k.startswith('_')}
+        attr = inspect.getmembers(self, lambda a: not (inspect.isroutine(a)))
+        js = {k: v for (k, v) in attr if not k.startswith('_')}
         json_rules = [r.to_json() for r in self.rules]
         js['rules'] = json_rules
         return js

+ 2 - 2
cloudbridge/providers/openstack/resources.py

@@ -1169,8 +1169,8 @@ class OpenStackVMFirewall(BaseVMFirewall):
             self.id)
 
     def to_json(self):
-        attr = inspect.getmembers(self, lambda a: not(inspect.isroutine(a)))
-        js = {k: v for(k, v) in attr if not k.startswith('_')}
+        attr = inspect.getmembers(self, lambda a: not (inspect.isroutine(a)))
+        js = {k: v for (k, v) in attr if not k.startswith('_')}
         json_rules = [r.to_json() for r in self.rules]
         js['rules'] = json_rules
         return js