integ/config/puppet-modules/openstack/puppet-openstacklib-17.4.0/debian/patches/0001-Adapt-first-set-of-legacy-patches.patch
Dan Voiculeasa cd1d5037e0 Add debian package for puppet-module-openstacklib-17.4.0
Aligned with Debian Bullseye version
puppet-module-openstacklib-17.4.0-2.

Did build puppet-openstacklib-17.4.0 + starlingx patches (adapted from
CentOS7). Adapted all patches.
Adapt patch 0001. Drop patch 0002, as it is merged upstream.
Did build an iso.

Story: 2009101
Task: 43366
Signed-off-by: Dan Voiculeasa <dan.voiculeasa@windriver.com>
Change-Id: I2b85edb0ec0712b32709b3368a6924f6c707615b
2021-09-23 18:41:33 +03:00

89 lines
3.2 KiB
Diff

From 76473fecb52b01f122c50dba751732dfa7da2948 Mon Sep 17 00:00:00 2001
From: Dan Voiculeasa <dan.voiculeasa@windriver.com>
Date: Mon, 20 Sep 2021 12:05:10 +0300
Subject: [PATCH] Adapt first set of legacy patches
Adapt 0001-Roll-up-TIS-patches.patch from CentOS.
Signed-off-by: Dan Voiculeasa <dan.voiculeasa@windriver.com>
---
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 3d80d68..280315c 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')
execute([command(:openstack_command)] + args, override_locale: false, failonfail: true, combine: true)
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 afade9c..8f0c953 100644
--- a/lib/puppet/provider/openstack/credentials.rb
+++ b/lib/puppet/provider/openstack/credentials.rb
@@ -67,11 +67,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
]
--
2.30.0