Skip to content

Commit

Permalink
Try to correct unsafe_interpolations lint check
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Riehecky committed Aug 25, 2023
1 parent c36c053 commit df46aa3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@

if $default_zone {
exec { 'firewalld::set_default_zone':
command => "firewall-cmd --set-default-zone ${default_zone} || firewall-offline-cmd --set-default-zone ${default_zone}",
command => ['firewall-cmd --set-default-zone ', $default_zone, ' || firewall-offline-cmd --set-default-zone ', $default_zone],
unless => "[ $(firewall-cmd --get-default-zone || firewall-offline-cmd --get-default-zone) = ${default_zone} ]",
require => Service['firewalld'],
}
Expand All @@ -185,7 +185,7 @@

if $log_denied {
exec { 'firewalld::set_log_denied':
command => "firewall-cmd --set-log-denied ${log_denied} || firewall-offline-cmd --set-log-denied ${log_denied}",
command => ['firewall-cmd --set-log-denied ', $log_denied, ' || firewall-offline-cmd --set-log-denied ', $log_denied],
unless => "[ $(firewall-cmd --get-log-denied || firewall-offline-cmd --get-log-denied) = ${log_denied} ]",
require => Service['firewalld'],
}
Expand Down
6 changes: 3 additions & 3 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

it do
is_expected.to contain_exec('firewalld::set_default_zone').with(
command: 'firewall-cmd --set-default-zone restricted || firewall-offline-cmd --set-default-zone restricted',
command: ['firewall-cmd --set-default-zone ', 'restricted', ' || firewall-offline-cmd --set-default-zone ', 'restricted'],
unless: '[ $(firewall-cmd --get-default-zone || firewall-offline-cmd --get-default-zone) = restricted ]'
).that_requires('Service[firewalld]')
end
Expand Down Expand Up @@ -243,7 +243,7 @@

it do
is_expected.to contain_exec('firewalld::set_default_zone').with(
command: 'firewall-cmd --set-default-zone public || firewall-offline-cmd --set-default-zone public',
command: ['firewall-cmd --set-default-zone ', 'public', ' || firewall-offline-cmd --set-default-zone ', 'public'],
unless: '[ $(firewall-cmd --get-default-zone || firewall-offline-cmd --get-default-zone) = public ]'
).that_requires('Service[firewalld]')
end
Expand All @@ -259,7 +259,7 @@

it do
is_expected.to contain_exec('firewalld::set_log_denied').with(
command: "firewall-cmd --set-log-denied #{cond} || firewall-offline-cmd --set-log-denied #{cond}",
command: ['firewall-cmd --set-log-denied ', cond, ' || firewall-offline-cmd --set-log-denied ', cond],
unless: "[ $(firewall-cmd --get-log-denied || firewall-offline-cmd --get-log-denied) = #{cond} ]"
).that_requires('Service[firewalld]')
end
Expand Down

0 comments on commit df46aa3

Please sign in to comment.