Skip to content

Commit 9dbc13b

Browse files
committed
(MAINT) Apply lint autofixes
Prior to this commit lint would not work properly in Github Actions. This commit aims to fix the problems that cause failure in CI.
1 parent 26e242e commit 9dbc13b

File tree

9 files changed

+22
-21
lines changed

9 files changed

+22
-21
lines changed

manifests/compose.pp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,11 @@
8989
ensure_packages(['curl'])
9090
}
9191

92+
$compose_install = "curl -s -S -L ${proxy_opt} ${docker_compose_url} -o ${docker_compose_location_versioned}"
9293
exec { "Install Docker Compose ${version}":
9394
path => '/usr/bin/',
9495
cwd => '/tmp',
95-
command => ['curl', '-s', '-S', '-L', $proxy_opt, $docker_compose_url, '-o', $docker_compose_location_versioned],
96+
command => $compose_install,
9697
creates => $docker_compose_location_versioned,
9798
require => Package['curl'],
9899
}

manifests/install.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
}
114114
}
115115

116-
$fail_restart_command = ['SC.exe', 'failure', 'Docker', 'reset= 432000', 'actions= restart/30000/restart/60000/restart/60000']
116+
$fail_restart_command = 'SC.exe failure Docker reset= 432000 actions= restart/30000/restart/60000/restart/60000'
117117
exec { 'service-restart-on-failure':
118118
command => $fail_restart_command,
119119
refreshonly => true,

manifests/plugin.pp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868
}
6969
)
7070

71-
$exec_install = [$docker_command, 'install', $docker_plugin_install_flags]
72-
$unless_install = [$docker_command, 'ls', "--format='{{.PluginReference}}' | grep -w ${plugin_name}"]
71+
$exec_install = "${docker_command} install ${docker_plugin_install_flags}"
72+
$unless_install = "${docker_command} ls --format='{{.PluginReference}}' | grep -w ${plugin_name}"
7373

7474
exec { "plugin install ${plugin_name}":
7575
command => $exec_install,
@@ -86,7 +86,7 @@
8686
)
8787

8888
$exec_rm = [$docker_command, 'rm', $docker_plugin_remove_flags]
89-
$onlyif_rm = [$docker_command, 'ls', "--format='{{.PluginReference}}' | grep -w ${plugin_name}"]
89+
$onlyif_rm = "${docker_command} ls --format='{{.PluginReference}}' | grep -w ${plugin_name}"
9090

9191
exec { "plugin remove ${plugin_name}":
9292
command => $exec_rm,
@@ -106,7 +106,7 @@
106106
)
107107

108108
$exec_enable = [$docker_command, 'enable', $docker_plugin_enable_flags]
109-
$onlyif_enable = [$docker_command, 'ls', '-f', "enabled=false --format='{{.PluginReference}}' | grep -w ${plugin_name}"]
109+
$onlyif_enable = "${docker_command} ls -f enabled=false --format='{{.PluginReference}}' | grep -w ${plugin_name}"
110110

111111
exec { "plugin enable ${plugin_name}":
112112
command => $exec_enable,
@@ -117,7 +117,7 @@
117117
}
118118
} elsif $enabled == false {
119119
$else_command = [$docker_command, 'disable', $plugin_name]
120-
$else_unless = [$docker_command, 'ls', '-f', "enabled=false --format='{{.PluginReference}}' | grep -w ${plugin_name}"]
120+
$else_unless = "${docker_command} ls -f enabled=false --format='{{.PluginReference}}' | grep -w ${plugin_name}"
121121

122122
exec { "disable ${plugin_name}":
123123
command => $else_command,

manifests/run.pp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@
399399
timeout => $exec_timeout,
400400
}
401401

402-
$restart_remove_command = [$docker_command, 'rm', '-v', $sanitised_title]
402+
$restart_remove_command = "${docker_command} rm -v ${sanitised_title}"
403403
$restart_remove_onlyif = [$docker_command, 'inspect', $sanitised_title]
404404

405405
exec { "remove ${title} with docker":
@@ -527,8 +527,8 @@
527527

528528
if $ensure == 'absent' {
529529
if $facts['os']['family'] == 'windows' {
530-
$absent_stop_command = [$docker_command, 'stop', "--time=${stop_wait_time}", $sanitised_title]
531-
$absent_stop_onlyif = [$docker_command, 'inspect', $sanitised_title]
530+
$absent_stop_command = "${docker_command} stop --time=${stop_wait_time} ${sanitised_title}"
531+
$absent_stop_onlyif = "${docker_command} inspect ${sanitised_title}"
532532

533533
exec { "stop container ${service_prefix}${sanitised_title}":
534534
command => $absent_stop_command,
@@ -549,8 +549,8 @@
549549
notify => Exec["remove container ${service_prefix}${sanitised_title}"],
550550
}
551551
}
552-
$absent_remove_command = [$docker_command, 'rm', '-v', $sanitised_title]
553-
$absent_remove_onlyif = [$docker_command, 'inspect', $sanitised_title]
552+
$absent_remove_command = "${docker_command} rm -v ${sanitised_title}"
553+
$absent_remove_onlyif = "${docker_command} inspect ${sanitised_title}"
554554

555555
exec { "remove container ${service_prefix}${sanitised_title}":
556556
command => $absent_remove_command,

manifests/services.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
)
134134

135135
$exec_create = [$docker_command, 'create', '--name', $docker_service_create_flags]
136-
$unless_create = ['docker', 'service', 'ps', "${service_name}"]
136+
$unless_create = "docker service ps ${service_name}"
137137

138138
exec { "${title} docker service create":
139139
command => $exec_create,

spec/shared_examples/compose.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
is_expected.to contain_exec("Install Docker Compose #{version}").with(
6363
'path' => '/usr/bin/',
6464
'cwd' => '/tmp',
65-
'command' => ['curl', '-s', '-S', '-L', proxy_opt, docker_compose_url, '-o', docker_compose_location_versioned],
65+
'command' => "curl -s -S -L #{proxy_opt} #{docker_compose_url} -o #{docker_compose_location_versioned}",
6666
'creates' => docker_compose_location_versioned,
6767
).that_requires(
6868
'Package[curl]',

spec/shared_examples/install.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141

142142
it {
143143
is_expected.to contain_exec('service-restart-on-failure').with(
144-
'command' => ['SC.exe', 'failure', 'Docker', 'reset= 432000', 'actions= restart/30000/restart/60000/restart/60000'],
144+
'command' => 'SC.exe failure Docker reset= 432000 actions= restart/30000/restart/60000/restart/60000',
145145
'refreshonly' => true,
146146
'logoutput' => true,
147147
'provider' => 'powershell',

spec/shared_examples/plugin.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
'settings' => settings,
2525
)
2626

27-
exec_install = [docker_command, 'install', docker_plugin_install_flags]
28-
unless_install = [docker_command, 'ls', "--format='{{.PluginReference}}' | grep -w #{plugin_name}"]
27+
exec_install = "#{docker_command} install #{docker_plugin_install_flags}"
28+
unless_install = "#{docker_command} ls --format='{{.PluginReference}}' | grep -w #{plugin_name}"
2929

3030
it {
3131
is_expected.to contain_exec("plugin install #{plugin_name}").with(
@@ -44,7 +44,7 @@
4444
)
4545

4646
exec_rm = [docker_command, 'rm', docker_plugin_remove_flags]
47-
onlyif_rm = [docker_command, 'ls', "--format='{{.PluginReference}}' | grep -w #{plugin_name}"]
47+
onlyif_rm = "#{docker_command} ls --format='{{.PluginReference}}' | grep -w #{plugin_name}"
4848

4949
it {
5050
is_expected.to contain_exec("plugin remove #{plugin_name}").with(
@@ -65,7 +65,7 @@
6565
)
6666

6767
exec_enable = [docker_command, 'enable', docker_plugin_enable_flags]
68-
onlyif_enable = [docker_command, 'ls', '-f', "enabled=false --format='{{.PluginReference}}' | grep -w #{plugin_name}"]
68+
onlyif_enable = "#{docker_command} ls -f enabled=false --format='{{.PluginReference}}' | grep -w #{plugin_name}"
6969

7070
it {
7171
is_expected.to contain_exec("plugin enable #{plugin_name}").with(
@@ -78,7 +78,7 @@
7878
}
7979
else
8080
else_command = [docker_command, 'disable', plugin_name]
81-
else_unless = [docker_command, 'ls', '-f', "enabled=false --format='{{.PluginReference}}' | grep -w #{plugin_name}"]
81+
else_unless = "#{docker_command} ls -f enabled=false --format='{{.PluginReference}}' | grep -w #{plugin_name}"
8282

8383
it {
8484
is_expected.to contain_exec("disable #{plugin_name}").with(

spec/shared_examples/services.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
)
5858

5959
exec_create = [docker_command, 'create', '--name', docker_service_create_flags]
60-
unless_create = ['docker', 'service', 'ps', "#{service_name == :undef ? '' : service_name}"]
60+
unless_create = "docker service ps #{service_name == :undef ? '' : service_name}"
6161

6262
it {
6363
is_expected.to contain_exec("#{title} docker service create").with(

0 commit comments

Comments
 (0)