fix up rackspace/openstack cloud test

This commit is contained in:
Daniel Wallace 2017-12-29 09:02:54 -07:00
parent d595c7af36
commit 1182f250ca
No known key found for this signature in database
GPG key ID: 5FA5E5544F010D48

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)
)