From 7147ba03233c110f3e7302aaa5d80fc1213ade8b Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Fri, 18 Sep 2015 13:27:43 -0400 Subject: [PATCH] glance_image: hardcode os-image-api-version to 1 Glance_image provider is using 'openstack image create' operation to create an image. This operation is supported by glanceclient but not in openstackclient. Since openstackclient recently switched the default image-api-version to 2, we need to hardcode the version when using this operation so we can still create images with openstackclient. See https://bugs.launchpad.net/python-openstackclient/+bug/1405562 Closes-Bug: 1497385 Change-Id: I68adf3fb5c983f37b4b80171466928f6b94a0f6d --- lib/puppet/provider/glance_image/openstack.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/puppet/provider/glance_image/openstack.rb b/lib/puppet/provider/glance_image/openstack.rb index 72628150..134b3310 100644 --- a/lib/puppet/provider/glance_image/openstack.rb +++ b/lib/puppet/provider/glance_image/openstack.rb @@ -10,6 +10,12 @@ Puppet::Type.type(:glance_image).provide( @credentials = Puppet::Provider::Openstack::CredentialsV2_0.new + # glanceclient support `image create` (in v2 API) but not openstackclient + # openstackclient now uses image v2 API by default. + # in the meantime it's implemented in openstackclient, hardcode version + # see https://bugs.launchpad.net/python-openstackclient/+bug/1405562 + ENV['OS_IMAGE_API_VERSION'] = '1' + def initialize(value={}) super(value) @property_flush = {}