Merge pull request #45218 from gtmanfred/oxygen

fix up rackspace/openstack cloud test
This commit is contained in:
Nicole Thomas 2018-01-02 11:35:04 -05:00 committed by GitHub
commit 70ccdef729
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,10 +18,10 @@ from salt.config import cloud_providers_config
# Import Third-Party Libs
try:
import libcloud # pylint: disable=unused-import
HAS_LIBCLOUD = True
import shade # pylint: disable=unused-import
HAS_SHADE = True
except ImportError:
HAS_LIBCLOUD = False
HAS_SHADE = False
# Create the cloud instance name to be used throughout the tests
INSTANCE_NAME = generate_random_name('CLOUD-TEST-')
@ -29,7 +29,7 @@ PROVIDER_NAME = 'rackspace'
DRIVER_NAME = 'openstack'
@skipIf(HAS_LIBCLOUD is False, 'salt-cloud requires >= libcloud 0.13.2')
@skipIf(HAS_SHADE is False, 'openstack driver requires `shade`')
class RackspaceTest(ShellCase):
'''
Integration tests for the Rackspace cloud provider using the Openstack driver
@ -62,12 +62,12 @@ class RackspaceTest(ShellCase):
)
)
user = config[profile_str][DRIVER_NAME]['user']
tenant = config[profile_str][DRIVER_NAME]['tenant']
api = config[profile_str][DRIVER_NAME]['apikey']
if api == '' or tenant == '' or user == '':
region_name = config[profile_str][DRIVER_NAME].get('region_name')
auth = config[profile_str][DRIVER_NAME].get('auth')
cloud = config[profile_str][DRIVER_NAME].get('cloud')
if region_name and (auth or cloud):
self.skipTest(
'A user, tenant, and an api key must be provided to run these '
'A region_name and (auth or cloud) must be provided to run these '
'tests. Check tests/integration/files/conf/cloud.providers.d/{0}.conf'
.format(PROVIDER_NAME)
)