From 651f0c38a1f364953dc3cb3f7458385410395fd8 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Wed, 10 Oct 2018 11:12:40 -0500 Subject: Handle not having cinderclient.v1 available The Cinder v1 API was deprecated several years ago and may be removed from python-cinderclient in the near future. To handle the case where v1 is no longer present, this updates cinderclient initialization to work without it and give an appropriate error if v1 is requested with a version where it is no longer available. Change-Id: I277d7b48b8ad4cce383ec3722f8117938378f615 Signed-off-by: Sean McGinnis --- openstackclient/volume/v2/volume.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'openstackclient/volume/v2/volume.py') diff --git a/openstackclient/volume/v2/volume.py b/openstackclient/volume/v2/volume.py index 8ab61d2a..7a5c207a 100644 --- a/openstackclient/volume/v2/volume.py +++ b/openstackclient/volume/v2/volume.py @@ -212,6 +212,9 @@ class CreateVolume(command.ShowOne): raise exceptions.CommandError( _("ERROR: --user is deprecated, please use" " --os-username instead.")) + if parsed_args.multi_attach: + LOG.warning(_("'--multi-attach' option is no longer supported by " + "the block storage service.")) volume = volume_client.volumes.create( size=size, @@ -224,7 +227,6 @@ class CreateVolume(command.ShowOne): imageRef=image, source_volid=source_volume, consistencygroup_id=consistency_group, - multiattach=parsed_args.multi_attach, scheduler_hints=parsed_args.hint, ) -- cgit v1.2.1