Bläddra i källkod

Zone is mandatory when creating a subnet

Nuwan Goonasekera 7 år sedan
förälder
incheckning
8c2d67ac88

+ 1 - 1
cloudbridge/cloud/base/resources.py

@@ -801,7 +801,7 @@ class BaseNetwork(BaseCloudResource, BaseObjectLifeCycleMixin, Network):
             timeout=timeout,
             timeout=timeout,
             interval=interval)
             interval=interval)
 
 
-    def create_subnet(self, label, cidr_block, zone=None):
+    def create_subnet(self, label, cidr_block, zone):
         return self._provider.networking.subnets.create(
         return self._provider.networking.subnets.create(
             label=label, network=self, cidr_block=cidr_block, zone=zone)
             label=label, network=self, cidr_block=cidr_block, zone=zone)
 
 

+ 1 - 1
cloudbridge/cloud/interfaces/resources.py

@@ -950,7 +950,7 @@ class Network(ObjectLifeCycleMixin, LabeledCloudResource):
         pass
         pass
 
 
     @abstractmethod
     @abstractmethod
-    def create_subnet(self, label, cidr_block, zone=None):
+    def create_subnet(self, label, cidr_block, zone):
         """
         """
         Create a new network subnet and associate it with this Network.
         Create a new network subnet and associate it with this Network.
 
 

+ 3 - 2
cloudbridge/cloud/providers/azure/resources.py

@@ -940,7 +940,7 @@ class AzureNetwork(BaseNetwork):
         """
         """
         return self._provider.networking.subnets.list(network=self.id)
         return self._provider.networking.subnets.list(network=self.id)
 
 
-    def create_subnet(self, label, cidr_block, zone=None):
+    def create_subnet(self, label, cidr_block, zone):
         """
         """
         Create the subnet with cidr_block
         Create the subnet with cidr_block
         :param cidr_block:
         :param cidr_block:
@@ -949,7 +949,8 @@ class AzureNetwork(BaseNetwork):
         :return:
         :return:
         """
         """
         return self._provider.networking.subnets. \
         return self._provider.networking.subnets. \
-            create(label=label, network=self.id, cidr_block=cidr_block)
+            create(label=label, network=self.id, cidr_block=cidr_block,
+                   zone=zone)
 
 
     @property
     @property
     def gateways(self):
     def gateways(self):