almahmoud 7 лет назад
Родитель
Сommit
3ed7906788

+ 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 self 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",

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

@@ -190,12 +190,12 @@ class GCEVMFirewallService(BaseVMFirewallService):
         network = (network if isinstance(network, GCENetwork)
                    else self.provider.networking.networks.get(network))
         fw = GCEVMFirewall(self._delegate, label, network, description)
+        fw.label = label
         # This rule exists implicitly. Add it explicitly so that the firewall
         # is not empty and the rule is shown by list/get/find methods.
-        fw.rules.create_with_priority(
-                direction=TrafficDirection.OUTBOUND, protocol='tcp',
-                priority=65534, cidr='0.0.0.0/0')
-        fw.label = label
+        self.provider.security._vm_firewall_rules.create_with_priority(
+            fw, direction=TrafficDirection.OUTBOUND, protocol='tcp',
+            priority=65534, cidr='0.0.0.0/0')
         return fw
 
     @dispatch(event="provider.security.vm_firewalls.delete",