diff --git a/config/puppet-modules/openstack/puppet-keystone-11.3.0/centos/meta_patches/0008-update-for-openstackclient-Train-upgrade.patch b/config/puppet-modules/openstack/puppet-keystone-11.3.0/centos/meta_patches/0008-update-for-openstackclient-Train-upgrade.patch new file mode 100644 index 000000000..e0828d31e --- /dev/null +++ b/config/puppet-modules/openstack/puppet-keystone-11.3.0/centos/meta_patches/0008-update-for-openstackclient-Train-upgrade.patch @@ -0,0 +1,33 @@ +From 37836a4a1ce5548f39a23f5686f6f7c12bef3504 Mon Sep 17 00:00:00 2001 +From: chenyan +Date: Thu, 26 Mar 2020 14:17:54 +0800 +Subject: [PATCH] update for openstackclient Train upgrade + +Signed-off-by: chenyan +--- + SPECS/puppet-keystone.spec | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/SPECS/puppet-keystone.spec b/SPECS/puppet-keystone.spec +index ae233f0..2e6ede3 100644 +--- a/SPECS/puppet-keystone.spec ++++ b/SPECS/puppet-keystone.spec +@@ -16,6 +16,7 @@ Patch0003: 0003-remove-eventlet_bindhost-from-Keystoneconf.patch + Patch0004: 0004-escape-special-characters-in-bootstrap.patch + Patch0005: 0005-Add-support-for-fernet-receipts.patch + Patch0006: 0006-update-Barbican-admin-secret-s-user-project-IDs-duri.patch ++Patch0007: 0007-update-for-openstackclient-Train-upgrade.patch + + BuildArch: noarch + +@@ -39,6 +40,7 @@ Puppet module for OpenStack Keystone + %patch0004 -p1 + %patch0005 -p1 + %patch0006 -p1 ++%patch0007 -p1 + + find . -type f -name ".*" -exec rm {} + + find . -size 0 -exec rm {} + +-- +2.17.1 + diff --git a/config/puppet-modules/openstack/puppet-keystone-11.3.0/centos/meta_patches/PATCH_ORDER b/config/puppet-modules/openstack/puppet-keystone-11.3.0/centos/meta_patches/PATCH_ORDER index ce35c5e99..d88b6efed 100644 --- a/config/puppet-modules/openstack/puppet-keystone-11.3.0/centos/meta_patches/PATCH_ORDER +++ b/config/puppet-modules/openstack/puppet-keystone-11.3.0/centos/meta_patches/PATCH_ORDER @@ -5,3 +5,4 @@ 0005-escape-special-characters-in-bootstrap.patch 0006-Add-support-for-fernet-receipts.patch 0007-update-Barbican-admin-secret-s-user-project-IDs.patch +0008-update-for-openstackclient-Train-upgrade.patch diff --git a/config/puppet-modules/openstack/puppet-keystone-11.3.0/centos/patches/0007-update-for-openstackclient-Train-upgrade.patch b/config/puppet-modules/openstack/puppet-keystone-11.3.0/centos/patches/0007-update-for-openstackclient-Train-upgrade.patch new file mode 100644 index 000000000..8236a10ff --- /dev/null +++ b/config/puppet-modules/openstack/puppet-keystone-11.3.0/centos/patches/0007-update-for-openstackclient-Train-upgrade.patch @@ -0,0 +1,86 @@ +From 77f06068cdad5a6a20635731a9d2df7e0cdca175 Mon Sep 17 00:00:00 2001 +From: chenyan +Date: Fri, 27 Mar 2020 10:41:38 +0800 +Subject: [PATCH] update for openstackclient Train upgrade + +Signed-off-by: chenyan +--- + lib/puppet/provider/keystone.rb | 10 +++++++--- + lib/puppet/provider/keystone_role/openstack.rb | 4 ++-- + lib/puppet/provider/keystone_user_role/openstack.rb | 4 ++-- + 3 files changed, 11 insertions(+), 7 deletions(-) + +diff --git a/lib/puppet/provider/keystone.rb b/lib/puppet/provider/keystone.rb +index 2c0b749..630692e 100644 +--- a/lib/puppet/provider/keystone.rb ++++ b/lib/puppet/provider/keystone.rb +@@ -213,7 +213,10 @@ class Puppet::Provider::Keystone < Puppet::Provider::Openstack + + def self.get_service_url + service_url = nil +- if ENV['OS_URL'] ++ if ENV['OS_ENDPOINT'] ++ service_url = ENV['OS_ENDPOINT'].dup ++ # Compatibility with pre-4.0.0 openstackclient ++ elsif ENV['OS_URL'] + service_url = ENV['OS_URL'].dup + elsif admin_endpoint + service_url = admin_endpoint +@@ -319,8 +322,9 @@ class Puppet::Provider::Keystone < Puppet::Provider::Openstack + + def self.request_by_service_token(service, action, error, properties=nil, options={}) + properties ||= [] +- @credentials.token = admin_token +- @credentials.url = service_url ++ @credentials.token = admin_token ++ @credentials.endpoint = service_url ++ @credentials.url = service_url + raise error unless @credentials.service_token_set? + Puppet::Provider::Openstack.request(service, action, properties, @credentials, options) + end +diff --git a/lib/puppet/provider/keystone_role/openstack.rb b/lib/puppet/provider/keystone_role/openstack.rb +index 60e3496..b8f3fa0 100644 +--- a/lib/puppet/provider/keystone_role/openstack.rb ++++ b/lib/puppet/provider/keystone_role/openstack.rb +@@ -51,7 +51,7 @@ Puppet::Type.type(:keystone_role).provide( + list = request('role', 'list') + reallist = list.collect do |role| + new( +- :name => role[:name], ++ :name => role[:name].downcase, + :ensure => :present, + :id => role[:id] + ) +@@ -63,7 +63,7 @@ Puppet::Type.type(:keystone_role).provide( + def self.prefetch(resources) + roles = instances + resources.keys.each do |name| +- if provider = roles.find{ |role| role.name == name } ++ if provider = roles.find{ |role| role.name == name.downcase } + resources[name].provider = provider + end + end +diff --git a/lib/puppet/provider/keystone_user_role/openstack.rb b/lib/puppet/provider/keystone_user_role/openstack.rb +index eee0768..b51c84e 100644 +--- a/lib/puppet/provider/keystone_user_role/openstack.rb ++++ b/lib/puppet/provider/keystone_user_role/openstack.rb +@@ -45,14 +45,14 @@ Puppet::Type.type(:keystone_user_role).provide( + end + + def exists? +- roles_db = self.class.request('role', 'list', properties) ++ roles_db = self.class.request('role assignment', 'list', ['--names'] + properties) + @property_hash[:name] = resource[:name] + if roles_db.empty? + @property_hash[:ensure] = :absent + else + @property_hash[:ensure] = :present + @property_hash[:roles] = roles_db.collect do |role| +- role[:name] ++ role[:role] + end + end + return @property_hash[:ensure] == :present +-- +2.17.1 + diff --git a/config/puppet-modules/openstack/puppet-openstacklib-11.3.0/centos/meta_patches/0003-update-for-openstackclient-Train.patch b/config/puppet-modules/openstack/puppet-openstacklib-11.3.0/centos/meta_patches/0003-update-for-openstackclient-Train.patch new file mode 100644 index 000000000..0d2df81e7 --- /dev/null +++ b/config/puppet-modules/openstack/puppet-openstacklib-11.3.0/centos/meta_patches/0003-update-for-openstackclient-Train.patch @@ -0,0 +1,33 @@ +From d977fad6b6844de7a22ab62e7456f27c95a56a64 Mon Sep 17 00:00:00 2001 +From: chenyan +Date: Thu, 26 Mar 2020 16:17:19 +0800 +Subject: [PATCH] update for openstackclient Train + +Signed-off-by: chenyan +--- + SPECS/puppet-openstacklib.spec | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/SPECS/puppet-openstacklib.spec b/SPECS/puppet-openstacklib.spec +index ce3957f..9f42722 100644 +--- a/SPECS/puppet-openstacklib.spec ++++ b/SPECS/puppet-openstacklib.spec +@@ -9,6 +9,7 @@ URL: https://launchpad.net/puppet-openstacklib + + Source0: https://tarballs.openstack.org/%{name}/%{name}-%{upstream_version}.tar.gz + Patch0001: 0001-Roll-up-TIS-patches.patch ++Patch0002: 0002-update-for-openstackclient-Train.patch + + BuildArch: noarch + +@@ -26,6 +27,7 @@ Puppet OpenStack Libraries + %prep + %setup -q -n openstack-openstacklib-%{upstream_version} + %patch0001 -p1 ++%patch0002 -p1 + + find . -type f -name ".*" -exec rm {} + + find . -size 0 -exec rm {} + +-- +2.17.1 + diff --git a/config/puppet-modules/openstack/puppet-openstacklib-11.3.0/centos/meta_patches/PATCH_ORDER b/config/puppet-modules/openstack/puppet-openstacklib-11.3.0/centos/meta_patches/PATCH_ORDER index e71cfd2d8..5e5b78ce3 100644 --- a/config/puppet-modules/openstack/puppet-openstacklib-11.3.0/centos/meta_patches/PATCH_ORDER +++ b/config/puppet-modules/openstack/puppet-openstacklib-11.3.0/centos/meta_patches/PATCH_ORDER @@ -1,2 +1,3 @@ 0001-Update-package-versioning-for-TIS-format.patch 0002-Add-TIS-patch.patch +0003-update-for-openstackclient-Train.patch diff --git a/config/puppet-modules/openstack/puppet-openstacklib-11.3.0/centos/patches/0002-update-for-openstackclient-Train.patch b/config/puppet-modules/openstack/puppet-openstacklib-11.3.0/centos/patches/0002-update-for-openstackclient-Train.patch new file mode 100644 index 000000000..d40f65c48 --- /dev/null +++ b/config/puppet-modules/openstack/puppet-openstacklib-11.3.0/centos/patches/0002-update-for-openstackclient-Train.patch @@ -0,0 +1,35 @@ +From f3769af45374b58ec9698a73676cbe088c112ac1 Mon Sep 17 00:00:00 2001 +From: chenyan +Date: Fri, 27 Mar 2020 10:48:23 +0800 +Subject: [PATCH] update for openstackclient Train + +Signed-off-by: chenyan +--- + lib/puppet/provider/openstack/credentials.rb | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/puppet/provider/openstack/credentials.rb b/lib/puppet/provider/openstack/credentials.rb +index 9c831e3..f43da5b 100644 +--- a/lib/puppet/provider/openstack/credentials.rb ++++ b/lib/puppet/provider/openstack/credentials.rb +@@ -5,7 +5,7 @@ class Puppet::Provider::Openstack::Credentials + + KEYS = [ + :auth_url, :password, :project_name, :username, +- :token, :url, ++ :token, :endpoint, :url, + :identity_api_version, + :region_name, + :interface +@@ -28,7 +28,7 @@ class Puppet::Provider::Openstack::Credentials + end + + def service_token_set? +- return true if @token && @url ++ return true if (@token && @endpoint) || (@token && @url) + end + + def to_env +-- +2.17.1 +