From fd985c46f5333aa78f3ef5873b9033009d6dc502 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 20 Nov 2023 00:07:53 +0900 Subject: [PATCH] Use new openstackclient tag This looses dependency using the new openstackclient tag, which requires only packages actually related to openstack CLI. Also, the troveclient package is required by trove so updating it should restart the services. Depends-on: https://review.opendev.org/899594 Change-Id: I52bf30c3ce857509ff1463abb7a493eb8dd48b97 --- lib/puppet/type/trove_datastore_version.rb | 4 ++++ manifests/client.pp | 4 +++- manifests/deps.pp | 12 +++++------- spec/classes/trove_client_spec.rb | 10 ++++++---- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/lib/puppet/type/trove_datastore_version.rb b/lib/puppet/type/trove_datastore_version.rb index 0ff447cd..8a824cf5 100644 --- a/lib/puppet/type/trove_datastore_version.rb +++ b/lib/puppet/type/trove_datastore_version.rb @@ -40,4 +40,8 @@ Puppet::Type.newtype(:trove_datastore_version) do autorequire(:anchor) do ['trove::service::end'] end + + autorequire(:trove_datastore) do + [self[:datastore]] + end end diff --git a/manifests/client.pp b/manifests/client.pp index 767280a7..88916910 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -37,10 +37,12 @@ class trove::client ( include trove::deps + # NOTE(tkajinam): trove-package tag is used because troveclient is required + # by trove package { 'python-troveclient': ensure => $package_ensure, name => $client_package_name, - tag => 'openstack', + tag => ['openstack', 'openstackclient', 'trove-package'], } include openstacklib::openstackclient diff --git a/manifests/deps.pp b/manifests/deps.pp index 9531d31a..244b54cd 100644 --- a/manifests/deps.pp +++ b/manifests/deps.pp @@ -46,16 +46,14 @@ class trove::deps { # before dbsync starts Oslo::Db<||> -> Anchor['trove::dbsync::begin'] - # We need troveclient installed before marking service end so that trove + # We need openstackclient installed before marking service end so that trove # will have clients available to create resources. This tag handles the - # troveclient but indirectly since the client is not available in + # openstackclient but indirectly since the client is not available in # all catalogs that don't need the client class (like many spec tests). - # Once the troveclient is installed we will setup the datastores and + # Once the openstackclient is installed we will setup the datastores and # datastore_versions. Datastore_versions must come after datastores. - Package<| tag == 'openstack'|> - ~> Anchor['trove::service::end'] - -> Trove_datastore<||> - -> Trove_datastore_version<||> + Package<| tag == 'openstackclient'|> + -> Anchor['trove::service::end'] # Installation or config changes will always restart services. Anchor['trove::install::end'] ~> Anchor['trove::service::begin'] diff --git a/spec/classes/trove_client_spec.rb b/spec/classes/trove_client_spec.rb index 175b7eb0..eccef442 100644 --- a/spec/classes/trove_client_spec.rb +++ b/spec/classes/trove_client_spec.rb @@ -28,8 +28,9 @@ describe 'trove::client' do context 'with default parameters' do it { is_expected.to contain_package('python-troveclient').with( - 'ensure' => 'present', - 'name' => platform_params[:client_package_name], + :ensure => 'present', + :name => platform_params[:client_package_name], + :tag => ['openstack', 'openstackclient', 'trove-package'] )} end @@ -38,8 +39,9 @@ describe 'trove::client' do { :package_ensure => false } end it { is_expected.to contain_package('python-troveclient').with( - 'ensure' => false, - 'name' => platform_params[:client_package_name], + :ensure => false, + :name => platform_params[:client_package_name], + :tag => ['openstack', 'openstackclient', 'trove-package'] )} end