From ba7d1d1ed3bad002ce36e5d4adf4e3794625091a Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Fri, 5 Sep 2014 14:50:31 +0100 Subject: Check OpenStack credentials in openstack.check If the credentials are wrong, then morph will fail before attempting the OpenStack deployment. To achieve that openstack.check will attempt to run `glance image-list`. --- morphlib/exts/openstack.write | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'morphlib/exts/openstack.write') diff --git a/morphlib/exts/openstack.write b/morphlib/exts/openstack.write index 8ee8767e..ac2e2c8a 100755 --- a/morphlib/exts/openstack.write +++ b/morphlib/exts/openstack.write @@ -96,27 +96,15 @@ class OpenStackWriteExtension(morphlib.writeexts.WriteExtension): self.unmount(mp) def get_openstack_parameters(self): - '''Check the environment variables needed and returns all. + '''Get the environment variables needed. The environment variables are described in the class documentation. ''' keys = ('OPENSTACK_USER', 'OPENSTACK_TENANT', 'OPENSTACK_IMAGENAME', 'OPENSTACK_PASSWORD') - for key in keys: - if key not in os.environ: - raise cliapp.AppException(key + ' was not given') return (os.environ[key] for key in keys) - def check_location(self, location): - x = urlparse.urlparse(location) - if x.scheme != 'http': - raise cliapp.AppException('URL schema must be http in %s' \ - % location) - if (x.path != '/v2.0' and x.path != '/v2.0/'): - raise cliapp.AppException('API version must be v2.0 in %s'\ - % location) - def configure_openstack_image(self, raw_disk, auth_url, os_params): '''Configure the image in OpenStack using glance-client''' self.status(msg='Configuring OpenStack image...') -- cgit v1.2.1