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
This commit is contained in:
Emilien Macchi 2015-09-18 13:27:43 -04:00
parent ed1425897f
commit 7147ba0323

View File

@ -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 = {}