From d8ab3c75341dfd601f06f0a46335574d39544bda Mon Sep 17 00:00:00 2001 From: Jackie Huang Date: Wed, 2 Jun 2021 16:23:04 +0800 Subject: [PATCH] puppet-openstacklib: update for stx 5.0 * inherit stx-metadata to help apply patches from stx 'integ' repo * remove the local copy of stx patches Issue-ID: INF-215 Signed-off-by: Jackie Huang Change-Id: I919b1ea65ba79f6ba0f3b830ca3e1a35fdbc2548 --- .../0001-Roll-up-TIS-patches.patch | 85 ---------------------- ...puppet-openstacklib-updates-for-poky-stx.patch} | 0 .../puppet/puppet-openstacklib_git.bbappend | 13 +++- 3 files changed, 10 insertions(+), 88 deletions(-) delete mode 100644 meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-openstacklib/0001-Roll-up-TIS-patches.patch rename meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-openstacklib/{0002-puppet-openstacklib-updates-for-poky-stx.patch => puppet-openstacklib-updates-for-poky-stx.patch} (100%) diff --git a/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-openstacklib/0001-Roll-up-TIS-patches.patch b/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-openstacklib/0001-Roll-up-TIS-patches.patch deleted file mode 100644 index 9f0328c..0000000 --- a/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-openstacklib/0001-Roll-up-TIS-patches.patch +++ /dev/null @@ -1,85 +0,0 @@ -From be4aad7589bc63f90b98b7d5692701a8368f8b04 Mon Sep 17 00:00:00 2001 -From: Al Bailey -Date: Mon, 11 Mar 2019 07:55:54 -0500 -Subject: [PATCH 1/3] Roll up TIS patches - ---- - lib/puppet/provider/openstack.rb | 1 + - lib/puppet/provider/openstack/auth.rb | 16 ++++++++++++++-- - lib/puppet/provider/openstack/credentials.rb | 2 -- - 3 files changed, 15 insertions(+), 4 deletions(-) - -diff --git a/lib/puppet/provider/openstack.rb b/lib/puppet/provider/openstack.rb -index 0240ce4..8b8e564 100644 ---- a/lib/puppet/provider/openstack.rb -+++ b/lib/puppet/provider/openstack.rb -@@ -45,6 +45,7 @@ class Puppet::Provider::Openstack < Puppet::Provider - begin - action = args[1] - Timeout.timeout(command_timeout(action)) do -+ args.unshift('--os-interface', 'internal') - openstack_command *args - end - rescue Timeout::Error -diff --git a/lib/puppet/provider/openstack/auth.rb b/lib/puppet/provider/openstack/auth.rb -index 743071d..4026aec 100644 ---- a/lib/puppet/provider/openstack/auth.rb -+++ b/lib/puppet/provider/openstack/auth.rb -@@ -1,9 +1,19 @@ - #require 'puppet/provider/openstack/credentials' - require File.join(File.dirname(__FILE__), '..','..','..', 'puppet/provider/openstack/credentials') -+require 'hiera_puppet' - - module Puppet::Provider::Openstack::Auth - -- RCFILENAME = "#{ENV['HOME']}/openrc" -+ RCFILENAME = "/etc/platform/openrc" -+ -+ def lookup_hiera(key) -+ HieraPuppet.lookup(key, :undef, self, nil, :priority) -+ end -+ -+ def get_admin_password -+ value=lookup_hiera('keystone::admin_password') -+ return value -+ end - - def get_os_vars_from_env - env = {} -@@ -17,7 +27,7 @@ module Puppet::Provider::Openstack::Auth - unless rcfile.nil? - File.open(rcfile).readlines.delete_if{|l| l=~ /^#|^$/ }.each do |line| - # we only care about the OS_ vars from the file LP#1699950 -- if line =~ /OS_/ -+ if line =~ /OS_/ and line.include?('=') - key, value = line.split('=') - key = key.split(' ').last - value = value.chomp.gsub(/'/, '') -@@ -38,6 +48,8 @@ module Puppet::Provider::Openstack::Auth - unless @credentials.set? - @credentials.unset - set_credentials(@credentials, get_os_vars_from_rcfile(rc_filename)) -+ # retrieves the password from hiera data since keyring is not yet available -+ @credentials.password = get_admin_password - end - unless @credentials.set? - raise(Puppet::Error::OpenstackAuthInputError, 'Insufficient credentials to authenticate') -diff --git a/lib/puppet/provider/openstack/credentials.rb b/lib/puppet/provider/openstack/credentials.rb -index 2765b2b..9c831e3 100644 ---- a/lib/puppet/provider/openstack/credentials.rb -+++ b/lib/puppet/provider/openstack/credentials.rb -@@ -70,11 +70,9 @@ class Puppet::Provider::Openstack::CredentialsV3 < Puppet::Provider::Openstack:: - :domain_id, - :domain_name, - :key, -- :project_domain_id, - :project_domain_name, - :project_id, - :trust_id, -- :user_domain_id, - :user_domain_name, - :user_id - ] --- -1.8.3.1 - diff --git a/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-openstacklib/0002-puppet-openstacklib-updates-for-poky-stx.patch b/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-openstacklib/puppet-openstacklib-updates-for-poky-stx.patch similarity index 100% rename from meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-openstacklib/0002-puppet-openstacklib-updates-for-poky-stx.patch rename to meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-openstacklib/puppet-openstacklib-updates-for-poky-stx.patch diff --git a/meta-starlingx/meta-stx-cloud/recipes-support/puppet/puppet-openstacklib_git.bbappend b/meta-starlingx/meta-stx-cloud/recipes-support/puppet/puppet-openstacklib_git.bbappend index 2b2d98e..51ce31d 100644 --- a/meta-starlingx/meta-stx-cloud/recipes-support/puppet/puppet-openstacklib_git.bbappend +++ b/meta-starlingx/meta-stx-cloud/recipes-support/puppet/puppet-openstacklib_git.bbappend @@ -1,8 +1,15 @@ +inherit stx-metadata + +STX_REPO = "integ" +STX_SUBPATH = "config/puppet-modules/openstack/${BP}/centos" + +SRC_URI_STX += " \ + file://patches/0001-Roll-up-TIS-patches.patch \ + file://patches/0002-update-for-openstackclient-Train.patch \ + " -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" SRC_URI += " \ - file://${BPN}/0001-Roll-up-TIS-patches.patch \ - file://${BPN}/0002-puppet-openstacklib-updates-for-poky-stx.patch \ + file://${BPN}/puppet-openstacklib-updates-for-poky-stx.patch \ " inherit openssl10 -- 2.16.6