almahmoud před 7 roky
rodič
revize
bfe0412245

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

@@ -1230,7 +1230,7 @@ class AWSFloatingIPService(BaseFloatingIPService):
     def list(self, gateway, limit=None, marker=None):
         log.debug("Listing all floating IPs under gateway %s", gateway)
         limit = limit or self.provider.config.default_result_limit
-        collection = self.boto_collection.filter()
+        collection = self.svc.boto_collection.filter()
         pag_type, resume_token, boto_objs = self.svc._make_query(collection,
                                                                  limit,
                                                                  marker)

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

@@ -1334,7 +1334,7 @@ class AzureFloatingIPService(BaseFloatingIPService):
     def get(self, gateway, fip_id):
         log.debug("Getting Azure Floating IP container with the id: %s",
                   fip_id)
-        fip = [fip for fip in gateway._floating_ips if fip.id == fip_id]
+        fip = [fip for fip in gateway.floating_ips if fip.id == fip_id]
         return fip[0] if fip else None
 
     @dispatch(event="provider.networking.floating_ips.list",

+ 6 - 4
cloudbridge/cloud/providers/gce/services.py

@@ -271,7 +271,7 @@ class GCEVMFirewallRuleService(BaseVMFirewallRuleService):
                 src_dest_tag, firewall.description,
                 firewall.network.name):
             return None
-        rules = self.find(direction=direction, protocol=protocol,
+        rules = self.find(firewall, direction=direction, protocol=protocol,
                           from_port=from_port, to_port=to_port, cidr=cidr,
                           src_dest_fw_id=src_dest_fw_id)
         if len(rules) < 1:
@@ -282,13 +282,15 @@ class GCEVMFirewallRuleService(BaseVMFirewallRuleService):
               priority=BaseVMFirewallRuleService.STANDARD_EVENT_PRIORITY)
     def create(self, firewall, direction, protocol, from_port=None,
                to_port=None, cidr=None, src_dest_fw=None):
-        return self.create_with_priority(direction, protocol, 1000, from_port,
-                                         to_port, cidr, src_dest_fw)
+        return self.create_with_priority(firewall, direction, protocol,
+                                         1000, from_port, to_port, cidr,
+                                         src_dest_fw)
 
     @dispatch(event="provider.security.vm_firewall_rules.delete",
               priority=BaseVMFirewallRuleService.STANDARD_EVENT_PRIORITY)
     def delete(self, firewall, rule):
-        rule = rule if isinstance(rule, GCEVMFirewallRule) else self.get(rule)
+        rule = (rule if isinstance(rule, GCEVMFirewallRule)
+                else self.get(firewall, rule))
         if rule.is_dummy_rule():
             return True
         firewall.delegate.delete_firewall_id(rule._rule)