From a765cea0479272fd5442dd33f6bd3a82a4a7812e Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 20 Aug 2025 00:45:45 +0900 Subject: [PATCH] Prepare for voxpupuli-puppet-lint-plugins Fix new lint errors detected when full of the voxpupili lint plugins are enabled. Change-Id: I2bdb5c200f3937ae018a8c34485ef3bd4d833763 Signed-off-by: Takashi Kajinami --- manifests/db/mysql.pp | 1 - manifests/db/mysql/host_access.pp | 1 - manifests/db/postgresql.pp | 3 +-- manifests/iscsid.pp | 3 +-- manifests/messaging/rabbitmq.pp | 4 +--- manifests/openstackclient.pp | 3 +-- manifests/params.pp | 1 - manifests/policy.pp | 17 +++++++++-------- manifests/policy/base.pp | 1 - manifests/policy/default.pp | 1 - manifests/policyrcd.pp | 3 +-- manifests/service_validation.pp | 5 +---- manifests/wsgi/apache.pp | 1 - 13 files changed, 15 insertions(+), 29 deletions(-) diff --git a/manifests/db/mysql.pp b/manifests/db/mysql.pp index 9fdb18de..41ce20bd 100644 --- a/manifests/db/mysql.pp +++ b/manifests/db/mysql.pp @@ -76,7 +76,6 @@ define openstacklib::db::mysql ( # DEPRECATED PARAMETER Optional[String[1]] $password_hash = undef, ) { - include mysql::server include mysql::client diff --git a/manifests/db/mysql/host_access.pp b/manifests/db/mysql/host_access.pp index b2ea87db..6d8cf3a6 100644 --- a/manifests/db/mysql/host_access.pp +++ b/manifests/db/mysql/host_access.pp @@ -45,7 +45,6 @@ define openstacklib::db::mysql::host_access ( Boolean $create_grant = true, Variant[String[1], Array[String[1]]] $tls_options = ['NONE'], ) { - if ! ($title =~ /_/) { fail('Title must be $dbname_$host') } diff --git a/manifests/db/postgresql.pp b/manifests/db/postgresql.pp index f6a43f3f..eb3e064e 100644 --- a/manifests/db/postgresql.pp +++ b/manifests/db/postgresql.pp @@ -38,8 +38,7 @@ define openstacklib::db::postgresql ( Variant[String[1], Array[String[1]]] $privileges = 'ALL', # DEPRECATED PARAMETERS Optional[String[1]] $password_hash = undef, -){ - +) { if $password_hash != undef { warning('The password_hash parameter was deprecated and will be removed in a future release. Use password instead') diff --git a/manifests/iscsid.pp b/manifests/iscsid.pp index 315a8895..c0f14d5f 100644 --- a/manifests/iscsid.pp +++ b/manifests/iscsid.pp @@ -16,12 +16,11 @@ # (optional) ensure state for package. # Defaults to 'present' # -class openstacklib::iscsid( +class openstacklib::iscsid ( Boolean $enabled = true, Boolean $manage_service = true, $package_ensure = 'present' ) { - include openstacklib::params package { 'open-iscsi': diff --git a/manifests/messaging/rabbitmq.pp b/manifests/messaging/rabbitmq.pp index 6c831e0f..0d3335f9 100644 --- a/manifests/messaging/rabbitmq.pp +++ b/manifests/messaging/rabbitmq.pp @@ -61,7 +61,7 @@ # (optional) Manage or not the vhost # Defaults to true # -define openstacklib::messaging::rabbitmq( +define openstacklib::messaging::rabbitmq ( String[1] $userid = 'guest', String[1] $password = 'guest', String[1] $virtual_host = '/', @@ -73,7 +73,6 @@ define openstacklib::messaging::rabbitmq( Boolean $manage_user_permissions = true, Boolean $manage_vhost = true, ) { - if $manage_user { if $userid == 'guest' { $is_admin_real = false @@ -101,5 +100,4 @@ define openstacklib::messaging::rabbitmq( 'provider' => 'rabbitmqctl', }) } - } diff --git a/manifests/openstackclient.pp b/manifests/openstackclient.pp index 86c6a2cc..0dc2dfb0 100644 --- a/manifests/openstackclient.pp +++ b/manifests/openstackclient.pp @@ -12,11 +12,10 @@ # (Optional) The name of the package to install # Defaults to $openstacklib::params::openstackclient_package_name # -class openstacklib::openstackclient( +class openstacklib::openstackclient ( $package_name = $openstacklib::params::openstackclient_package_name, $package_ensure = 'present', ) inherits openstacklib::params { - stdlib::ensure_packages($package_name, { 'ensure' => $package_ensure, 'tag' => ['openstack', 'openstackclient'] diff --git a/manifests/params.pp b/manifests/params.pp index 0d8a6b72..fec660ae 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -4,7 +4,6 @@ # should be considered to be constant # class openstacklib::params { - include openstacklib::defaults $openstackclient_package_name = 'python3-openstackclient' diff --git a/manifests/policy.pp b/manifests/policy.pp index 718502a7..ab0d8b78 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -60,15 +60,16 @@ define openstacklib::policy ( Enum['yaml'] $file_format = 'yaml', Boolean $purge_config = false, ) { - if empty($policies) { - create_resources('openstacklib::policy::default', { $policy_path => { - file_mode => $file_mode, - file_user => $file_user, - file_group => $file_group, - file_format => $file_format, - purge_config => $purge_config, - }}) + create_resources('openstacklib::policy::default', { + $policy_path => { + file_mode => $file_mode, + file_user => $file_user, + file_group => $file_group, + file_format => $file_format, + purge_config => $purge_config, + }, + }) } else { $policy_defaults = { file_path => $policy_path, diff --git a/manifests/policy/base.pp b/manifests/policy/base.pp index dd1e6777..43d91e1f 100644 --- a/manifests/policy/base.pp +++ b/manifests/policy/base.pp @@ -46,7 +46,6 @@ define openstacklib::policy::base ( Enum['yaml'] $file_format = 'yaml', Boolean $purge_config = false, ) { - ensure_resource('openstacklib::policy::default', $file_path, { file_path => $file_path, file_mode => $file_mode, diff --git a/manifests/policy/default.pp b/manifests/policy/default.pp index 2a990038..52615f19 100644 --- a/manifests/policy/default.pp +++ b/manifests/policy/default.pp @@ -37,7 +37,6 @@ define openstacklib::policy::default ( Enum['yaml'] $file_format = 'yaml', Boolean $purge_config = false, ) { - ensure_resource('file', $file_path, { mode => $file_mode, owner => $file_user, diff --git a/manifests/policyrcd.pp b/manifests/policyrcd.pp index 0220f63d..7a5bcad3 100644 --- a/manifests/policyrcd.pp +++ b/manifests/policyrcd.pp @@ -21,10 +21,9 @@ # (required) The services that should be in the policy-rc.d shell script # that should not autostart on install. # -class openstacklib::policyrcd( +class openstacklib::policyrcd ( Array[String[1]] $services ) { - if $facts['os']['family'] == 'Debian' { # We put this out there so openstack services wont auto start # when installed. diff --git a/manifests/service_validation.pp b/manifests/service_validation.pp index 91f735d3..50442062 100644 --- a/manifests/service_validation.pp +++ b/manifests/service_validation.pp @@ -65,7 +65,7 @@ # Environment to use # string; optional; default to empty array # -define openstacklib::service_validation( +define openstacklib::service_validation ( $command, $service_name = $name, $path = '/usr/bin:/bin:/usr/sbin:/sbin', @@ -78,7 +78,6 @@ define openstacklib::service_validation( $unless = undef, $environment = [], ) { - if $onlyif and $unless { fail ('Only one parameter should be declared: onlyif or unless') } @@ -99,6 +98,4 @@ define openstacklib::service_validation( anchor { "create ${service_name} anchor": } -> Exec<| title == "execute ${service_name} validation" |> - } - diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index 043cba49..9603f608 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -288,7 +288,6 @@ define openstacklib::wsgi::apache ( $error_log_syslog = undef, $log_level = undef, ) { - include apache # Ensure there's no trailing '/' except if this is also the only character