almahmoud 7 سال پیش
والد
کامیت
1912dd6e64
3فایلهای تغییر یافته به همراه25 افزوده شده و 23 حذف شده
  1. 5 5
      cloudbridge/cloud/providers/azure/resources.py
  2. 1 1
      cloudbridge/cloud/providers/openstack/services.py
  3. 19 17
      docs/topics/setup.rst

+ 5 - 5
cloudbridge/cloud/providers/azure/resources.py

@@ -3,6 +3,7 @@ DataTypes used by this provider
 """
 import collections
 import logging
+from uuid import uuid4
 
 from azure.common import AzureException
 from azure.mgmt.devtestlabs.models import GalleryImageReference
@@ -982,7 +983,7 @@ class AzureFloatingIPContainer(BaseFloatingIPContainer):
             'public_ip_allocation_method': 'Static'
         }
 
-        public_ip_name = self._generate_name_from_label('cb-fip', 'cb-fip')
+        public_ip_name = 'cb-fip-' + uuid4().hex[:6]
 
         floating_ip = self._provider.azure_client.\
             create_floating_ip(public_ip_name, public_ip_parameters)
@@ -1002,7 +1003,7 @@ class AzureFloatingIP(BaseFloatingIP):
 
     @property
     def name(self):
-        return self._ip.name
+        return self._ip.ip_address
 
     @property
     def resource_id(self):
@@ -1711,7 +1712,6 @@ class AzureInternetGateway(BaseInternetGateway):
     def __init__(self, provider, gateway, gateway_net):
         super(AzureInternetGateway, self).__init__(provider)
         self._gateway = gateway
-        self._name = None
         self._network_id = gateway_net.id if isinstance(
             gateway_net, AzureNetwork) else gateway_net
         self._state = ''
@@ -1720,11 +1720,11 @@ class AzureInternetGateway(BaseInternetGateway):
 
     @property
     def id(self):
-        return None
+        return "cb-gateway-wrapper"
 
     @property
     def name(self):
-        return None
+        return "cb-gateway-wrapper"
 
     @property
     def label(self):

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

@@ -873,7 +873,7 @@ class OpenStackSubnetService(BaseSubnetService):
                 return sn[0]
             # No default; create one
             net = self.provider.networking.networks.create(
-                label=OpenStackNetwork.CB_DEFAULT_NETWORK_NAME,
+                label=OpenStackNetwork.CB_DEFAULT_NETWORK_LABEL,
                 cidr_block='10.0.0.0/16')
             sn = net.create_subnet(
                 label=OpenStackSubnet.CB_DEFAULT_SUBNET_LABEL,

+ 19 - 17
docs/topics/setup.rst

@@ -164,20 +164,22 @@ In addition to the provider specific configuration variables above, there are
 some general configuration environment variables that apply to CloudBridge as
 a whole
 
-======================  ==================
-Variable		            Description
-======================  ==================
-CB_DEBUG                Setting ``CB_DEBUG=True`` will cause detailed debug
-                        output to be printed for each provider (including HTTP
-                        traces).
-CB_USE_MOCK_PROVIDERS   Setting this to ``True`` will cause the CloudBridge test
-                        suite to use mock drivers when available.
-CB_TEST_PROVIDER        Set this value to a valid :class:`.ProviderList` value
-                        such as ``aws``, to limit tests to that provider only.
-CB_DEFAULT_SUBNET_NAME  Name to be used for a subnet that will be considered
-                        the 'default' by the library. This default will be used
-                        only in cases there is no subnet marked as the default by the provider.
-CB_DEFAULT_NETWORK_NAME Name to be used for a network that will be considered
-                        the 'default' by the library. This default will be used
-                        only in cases there is no network marked as the default by the provider.
-======================= ==================
+======================== ======================================================
+Variable		                            Description
+======================== ======================================================
+CB_DEBUG                 Setting ``CB_DEBUG=True`` will cause detailed debug
+                         output to be printed for each provider (including HTTP
+                         traces).
+CB_USE_MOCK_PROVIDERS    Setting this to ``True`` will cause the CloudBridge
+                         test suite to use mock drivers when available.
+CB_TEST_PROVIDER         Set this value to a valid :class:`.ProviderList` value
+                         such as ``aws``, to limit tests to that provider only.
+CB_DEFAULT_SUBNET_LABEL  Name to be used for a subnet that will be considered
+                         the 'default' by the library. This default will be
+                         used only in cases there is no subnet marked as the
+                         default by the provider.
+CB_DEFAULT_NETWORK_LABEL Name to be used for a network that will be considered
+                         the 'default' by the library. This default will be
+                         used only in cases there is no network marked as the
+                         default by the provider.
+======================== ======================================================