From 3bc612652ea960107d1ef3382e09c982dd66d184 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 15 Aug 2025 20:00:00 +0900 Subject: [PATCH] Prepare for new lint plugins This fixes a few lint warnings/errors detected by the following plugins we aim to enable soon. - puppet-lint-file_ensure-check - puppet-lint-trailing_comma-check - puppet-lint-topscope-variable-check Change-Id: I777669d524fe98bcf866358294cb1ff7d2f69de1 Signed-off-by: Takashi Kajinami --- manifests/clouds.pp | 1 + manifests/iscsid.pp | 2 +- manifests/openstackclient.pp | 4 ++-- manifests/policy.pp | 2 +- manifests/policy/base.pp | 4 ++-- manifests/policyrcd.pp | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/manifests/clouds.pp b/manifests/clouds.pp index 7aee9461..08adfbd5 100644 --- a/manifests/clouds.pp +++ b/manifests/clouds.pp @@ -75,6 +75,7 @@ define openstacklib::clouds ( } file { $path: + ensure => file, mode => '0600', owner => $file_user, group => $file_group, diff --git a/manifests/iscsid.pp b/manifests/iscsid.pp index c4d727d4..315a8895 100644 --- a/manifests/iscsid.pp +++ b/manifests/iscsid.pp @@ -26,7 +26,7 @@ class openstacklib::iscsid( package { 'open-iscsi': ensure => $package_ensure, - name => $::openstacklib::params::open_iscsi_package_name, + name => $openstacklib::params::open_iscsi_package_name, tag => 'openstack', } diff --git a/manifests/openstackclient.pp b/manifests/openstackclient.pp index ef209393..86c6a2cc 100644 --- a/manifests/openstackclient.pp +++ b/manifests/openstackclient.pp @@ -10,10 +10,10 @@ # # [*package_name*] # (Optional) The name of the package to install -# Defaults to $::openstacklib::params::openstackclient_package_name +# Defaults to $openstacklib::params::openstackclient_package_name # class openstacklib::openstackclient( - $package_name = $::openstacklib::params::openstackclient_package_name, + $package_name = $openstacklib::params::openstackclient_package_name, $package_ensure = 'present', ) inherits openstacklib::params { diff --git a/manifests/policy.pp b/manifests/policy.pp index b4e16020..718502a7 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -76,7 +76,7 @@ define openstacklib::policy ( file_user => $file_user, file_group => $file_group, file_format => $file_format, - purge_config => $purge_config + purge_config => $purge_config, } create_resources('openstacklib::policy::base', $policies, $policy_defaults) diff --git a/manifests/policy/base.pp b/manifests/policy/base.pp index 56b6672d..dd1e6777 100644 --- a/manifests/policy/base.pp +++ b/manifests/policy/base.pp @@ -53,7 +53,7 @@ define openstacklib::policy::base ( file_user => $file_user, file_group => $file_group, file_format => $file_format, - purge_config => $purge_config + purge_config => $purge_config, }) # NOTE(tkajianm): Currently we use single quotes('') to quote the whole @@ -65,7 +65,7 @@ define openstacklib::policy::base ( file_line { "${file_path}-${key}" : path => $file_path, line => "'${key}': '${value_real}'", - match => "^['\"]?${key}(?!:)['\"]?\\s*:.+" + match => "^['\"]?${key}(?!:)['\"]?\\s*:.+", } Openstacklib::Policy::Default<| title == $file_path |> -> File_line<| title == "${file_path}-${key}" |> diff --git a/manifests/policyrcd.pp b/manifests/policyrcd.pp index 4d554c24..0220f63d 100644 --- a/manifests/policyrcd.pp +++ b/manifests/policyrcd.pp @@ -29,7 +29,7 @@ class openstacklib::policyrcd( # We put this out there so openstack services wont auto start # when installed. file { '/usr/sbin/policy-rc.d': - ensure => present, + ensure => file, content => template('openstacklib/policy-rc.d.erb'), mode => '0755', owner => root,