Browse Source

Ignore onwer_specifed.* properties in images

Since Ussuri release, openstackclient uses OpenStackSDK instead of
glanceclient to create an image[1]. This switch made "openstack image
create" command to create images with owner_specified.* properties.

This patch makes glance_image type filter out these properties to avoid
false changes in image properties.

[1] 60e7c51df4

Change-Id: I0439509589a7b28daf96d5a88ae2f5e01a27cf40
(cherry picked from commit 15d4c59153)
changes/87/748787/1
Takashi Kajinami 1 month ago
parent
commit
1622ed1e70
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      lib/puppet/provider/glance_image/openstack.rb

+ 9
- 1
lib/puppet/provider/glance_image/openstack.rb View File

@@ -145,7 +145,7 @@ Puppet::Type.type(:glance_image).provide(
:disk_format => attrs[:disk_format],
:min_disk => attrs[:min_disk],
:min_ram => attrs[:min_ram],
:properties => exclude_readonly_props(properties),
:properties => exclude_owner_specified_props(exclude_readonly_props(properties)),
:image_tag => attrs[:image_tag]
)
end
@@ -189,6 +189,14 @@ Puppet::Type.type(:glance_image).provide(
return rv
end

def self.exclude_owner_specified_props(props)
if props == nil
return nil
end
rv = props.select { |k, v| not k.start_with?('owner_specified.') }
return rv
end

def props_to_s(props)
hidden = ['os_hash_algo', 'os_hash_value', 'os_hidden']
props.flat_map{ |k, v|


Loading…
Cancel
Save