Skip to content

Commit 3383dae

Browse files
Cookstyle 8.0.0 Fixes
Issues found and resolved with: resources/container.rb - 71:3 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 204:18 warning: Lint/RedundantTypeConversion - Redundant to_a detected. - 474:9 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 475:9 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 476:9 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 477:9 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 478:9 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 479:9 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 480:9 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 481:9 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 482:9 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 483:9 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 484:9 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 485:9 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 486:9 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 487:9 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 489:9 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 490:9 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 491:9 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 492:9 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 493:9 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 494:9 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 495:9 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 496:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 497:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 498:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 499:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 500:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 501:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 502:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 503:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 504:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 505:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 506:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 507:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 508:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 509:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 510:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 511:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 512:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 513:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 516:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 517:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 518:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 519:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 520:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 521:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 522:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 524:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 525:13 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 528:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 529:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 530:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 531:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 532:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 533:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 534:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 535:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 536:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 537:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 538:11 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 694:43 convention: Style/RedundantParentheses - Don't use parentheses around a logical expression. Issues found and resolved with: resources/exec.rb - 10:3 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. Issues found and resolved with: resources/installation_package.rb - 122:5 convention: Style/RedundantReturn - Redundant return detected. https://rubystyle.guideno-explicit-return - 127:5 convention: Style/RedundantReturn - Redundant return detected. https://rubystyle.guideno-explicit-return Issues found and resolved with: resources/partial/_base.rb - 30:11 convention: Layout/ArrayAlignment - Align the elements of an array literal if they span more than one line. https://rubystyle.guideno-double-indent - 31:11 convention: Layout/ArrayAlignment - Align the elements of an array literal if they span more than one line. https://rubystyle.guideno-double-indent - 32:11 convention: Layout/ArrayAlignment - Align the elements of an array literal if they span more than one line. https://rubystyle.guideno-double-indent Issues found and resolved with: test/cookbooks/docker_test/recipes/container.rb - 314:5 convention: Layout/FirstHashElementIndentation - Use 2 spaces for indentation in a hash, relative to the first position after the preceding left parenthesis. - 315:5 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 316:5 convention: Layout/HashAlignment - Align the keys of a hash literal if they span more than one line. - 317:3 convention: Layout/FirstHashElementIndentation - Indent the right brace the same as the first position after the preceding left parenthesis. Signed-off-by: kitchen-porter <[email protected]>
1 parent 2a3dd8f commit 3383dae

File tree

6 files changed

+144
-72
lines changed

6 files changed

+144
-72
lines changed

CHANGELOG.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,78 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
- resolved cookstyle error: resources/container.rb:71:3 convention: `Layout/HashAlignment`
11+
- resolved cookstyle error: resources/container.rb:204:18 warning: `Lint/RedundantTypeConversion`
12+
- resolved cookstyle error: resources/container.rb:474:9 convention: `Layout/HashAlignment`
13+
- resolved cookstyle error: resources/container.rb:475:9 convention: `Layout/HashAlignment`
14+
- resolved cookstyle error: resources/container.rb:476:9 convention: `Layout/HashAlignment`
15+
- resolved cookstyle error: resources/container.rb:477:9 convention: `Layout/HashAlignment`
16+
- resolved cookstyle error: resources/container.rb:478:9 convention: `Layout/HashAlignment`
17+
- resolved cookstyle error: resources/container.rb:479:9 convention: `Layout/HashAlignment`
18+
- resolved cookstyle error: resources/container.rb:480:9 convention: `Layout/HashAlignment`
19+
- resolved cookstyle error: resources/container.rb:481:9 convention: `Layout/HashAlignment`
20+
- resolved cookstyle error: resources/container.rb:482:9 convention: `Layout/HashAlignment`
21+
- resolved cookstyle error: resources/container.rb:483:9 convention: `Layout/HashAlignment`
22+
- resolved cookstyle error: resources/container.rb:484:9 convention: `Layout/HashAlignment`
23+
- resolved cookstyle error: resources/container.rb:485:9 convention: `Layout/HashAlignment`
24+
- resolved cookstyle error: resources/container.rb:486:9 convention: `Layout/HashAlignment`
25+
- resolved cookstyle error: resources/container.rb:487:9 convention: `Layout/HashAlignment`
26+
- resolved cookstyle error: resources/container.rb:489:9 convention: `Layout/HashAlignment`
27+
- resolved cookstyle error: resources/container.rb:490:9 convention: `Layout/HashAlignment`
28+
- resolved cookstyle error: resources/container.rb:491:9 convention: `Layout/HashAlignment`
29+
- resolved cookstyle error: resources/container.rb:492:9 convention: `Layout/HashAlignment`
30+
- resolved cookstyle error: resources/container.rb:493:9 convention: `Layout/HashAlignment`
31+
- resolved cookstyle error: resources/container.rb:494:9 convention: `Layout/HashAlignment`
32+
- resolved cookstyle error: resources/container.rb:495:9 convention: `Layout/HashAlignment`
33+
- resolved cookstyle error: resources/container.rb:496:11 convention: `Layout/HashAlignment`
34+
- resolved cookstyle error: resources/container.rb:497:11 convention: `Layout/HashAlignment`
35+
- resolved cookstyle error: resources/container.rb:498:11 convention: `Layout/HashAlignment`
36+
- resolved cookstyle error: resources/container.rb:499:11 convention: `Layout/HashAlignment`
37+
- resolved cookstyle error: resources/container.rb:500:11 convention: `Layout/HashAlignment`
38+
- resolved cookstyle error: resources/container.rb:501:11 convention: `Layout/HashAlignment`
39+
- resolved cookstyle error: resources/container.rb:502:11 convention: `Layout/HashAlignment`
40+
- resolved cookstyle error: resources/container.rb:503:11 convention: `Layout/HashAlignment`
41+
- resolved cookstyle error: resources/container.rb:504:11 convention: `Layout/HashAlignment`
42+
- resolved cookstyle error: resources/container.rb:505:11 convention: `Layout/HashAlignment`
43+
- resolved cookstyle error: resources/container.rb:506:11 convention: `Layout/HashAlignment`
44+
- resolved cookstyle error: resources/container.rb:507:11 convention: `Layout/HashAlignment`
45+
- resolved cookstyle error: resources/container.rb:508:11 convention: `Layout/HashAlignment`
46+
- resolved cookstyle error: resources/container.rb:509:11 convention: `Layout/HashAlignment`
47+
- resolved cookstyle error: resources/container.rb:510:11 convention: `Layout/HashAlignment`
48+
- resolved cookstyle error: resources/container.rb:511:11 convention: `Layout/HashAlignment`
49+
- resolved cookstyle error: resources/container.rb:512:11 convention: `Layout/HashAlignment`
50+
- resolved cookstyle error: resources/container.rb:513:11 convention: `Layout/HashAlignment`
51+
- resolved cookstyle error: resources/container.rb:516:11 convention: `Layout/HashAlignment`
52+
- resolved cookstyle error: resources/container.rb:517:11 convention: `Layout/HashAlignment`
53+
- resolved cookstyle error: resources/container.rb:518:11 convention: `Layout/HashAlignment`
54+
- resolved cookstyle error: resources/container.rb:519:11 convention: `Layout/HashAlignment`
55+
- resolved cookstyle error: resources/container.rb:520:11 convention: `Layout/HashAlignment`
56+
- resolved cookstyle error: resources/container.rb:521:11 convention: `Layout/HashAlignment`
57+
- resolved cookstyle error: resources/container.rb:522:11 convention: `Layout/HashAlignment`
58+
- resolved cookstyle error: resources/container.rb:524:11 convention: `Layout/HashAlignment`
59+
- resolved cookstyle error: resources/container.rb:525:13 convention: `Layout/HashAlignment`
60+
- resolved cookstyle error: resources/container.rb:528:11 convention: `Layout/HashAlignment`
61+
- resolved cookstyle error: resources/container.rb:529:11 convention: `Layout/HashAlignment`
62+
- resolved cookstyle error: resources/container.rb:530:11 convention: `Layout/HashAlignment`
63+
- resolved cookstyle error: resources/container.rb:531:11 convention: `Layout/HashAlignment`
64+
- resolved cookstyle error: resources/container.rb:532:11 convention: `Layout/HashAlignment`
65+
- resolved cookstyle error: resources/container.rb:533:11 convention: `Layout/HashAlignment`
66+
- resolved cookstyle error: resources/container.rb:534:11 convention: `Layout/HashAlignment`
67+
- resolved cookstyle error: resources/container.rb:535:11 convention: `Layout/HashAlignment`
68+
- resolved cookstyle error: resources/container.rb:536:11 convention: `Layout/HashAlignment`
69+
- resolved cookstyle error: resources/container.rb:537:11 convention: `Layout/HashAlignment`
70+
- resolved cookstyle error: resources/container.rb:538:11 convention: `Layout/HashAlignment`
71+
- resolved cookstyle error: resources/container.rb:694:43 convention: `Style/RedundantParentheses`
72+
- resolved cookstyle error: resources/exec.rb:10:3 convention: `Layout/HashAlignment`
73+
- resolved cookstyle error: resources/installation_package.rb:122:5 convention: `Style/RedundantReturn`
74+
- resolved cookstyle error: resources/installation_package.rb:127:5 convention: `Style/RedundantReturn`
75+
- resolved cookstyle error: resources/partial/_base.rb:30:11 convention: `Layout/ArrayAlignment`
76+
- resolved cookstyle error: resources/partial/_base.rb:31:11 convention: `Layout/ArrayAlignment`
77+
- resolved cookstyle error: resources/partial/_base.rb:32:11 convention: `Layout/ArrayAlignment`
78+
- resolved cookstyle error: test/cookbooks/docker_test/recipes/container.rb:314:5 convention: `Layout/FirstHashElementIndentation`
79+
- resolved cookstyle error: test/cookbooks/docker_test/recipes/container.rb:315:5 convention: `Layout/HashAlignment`
80+
- resolved cookstyle error: test/cookbooks/docker_test/recipes/container.rb:316:5 convention: `Layout/HashAlignment`
81+
- resolved cookstyle error: test/cookbooks/docker_test/recipes/container.rb:317:3 convention: `Layout/FirstHashElementIndentation`
1082
## 11.9.2 - *2025-02-02*
1183

1284
## 11.9.1 - *2025-02-01*

resources/container.rb

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
property :sysctls, Hash, default: {}
6969
property :timeout, Integer, desired_state: false
7070
property :tmpfs, [Hash, Array], default: {}, coerce: proc { |v| coerce_tmpfs(v) },
71-
description: 'A hash or array of tmpfs mounts to add to the container. Hash format: { "/path" => "size=100M,uid=1000" }. Array format: ["/path", "/path2"]. See https://docs.docker.com/storage/tmpfs/'
71+
description: 'A hash or array of tmpfs mounts to add to the container. Hash format: { "/path" => "size=100M,uid=1000" }. Array format: ["/path", "/path2"]. See https://docs.docker.com/storage/tmpfs/'
7272
property :tty, [true, false], default: false
7373
property :ulimits, [Array, nil], coerce: proc { |v| coerce_ulimits(v) }
7474
property :user, String
@@ -201,7 +201,7 @@ def coerce_volumes(v)
201201
PartialHash[v]
202202
else
203203
b = []
204-
v = Array(v).to_a # in case v.is_A?(Chef::Node::ImmutableArray)
204+
v = Array(v) # in case v.is_A?(Chef::Node::ImmutableArray)
205205
v.delete_if do |x|
206206
parts = x.split(':')
207207
b << x if parts.length > 1
@@ -471,71 +471,71 @@ def load_container_labels
471471

472472
with_retries do
473473
config = {
474-
'name' => new_resource.container_name,
475-
'Image' => new_resource.tag.to_s.start_with?('sha256:') ? "#{new_resource.repo}@#{new_resource.tag}" : "#{new_resource.repo}:#{new_resource.tag}",
476-
'Labels' => new_resource.labels,
477-
'Cmd' => to_shellwords(new_resource.command),
478-
'AttachStderr' => new_resource.attach_stderr,
479-
'AttachStdin' => new_resource.attach_stdin,
480-
'AttachStdout' => new_resource.attach_stdout,
481-
'Domainname' => new_resource.domain_name,
482-
'Entrypoint' => to_shellwords(new_resource.entrypoint),
483-
'Env' => new_resource.env + read_env_file,
484-
'ExposedPorts' => new_resource.exposed_ports,
485-
'Healthcheck' => new_resource.health_check,
486-
'Hostname' => parsed_hostname,
487-
'MacAddress' => new_resource.mac_address,
474+
'name' => new_resource.container_name,
475+
'Image' => new_resource.tag.to_s.start_with?('sha256:') ? "#{new_resource.repo}@#{new_resource.tag}" : "#{new_resource.repo}:#{new_resource.tag}",
476+
'Labels' => new_resource.labels,
477+
'Cmd' => to_shellwords(new_resource.command),
478+
'AttachStderr' => new_resource.attach_stderr,
479+
'AttachStdin' => new_resource.attach_stdin,
480+
'AttachStdout' => new_resource.attach_stdout,
481+
'Domainname' => new_resource.domain_name,
482+
'Entrypoint' => to_shellwords(new_resource.entrypoint),
483+
'Env' => new_resource.env + read_env_file,
484+
'ExposedPorts' => new_resource.exposed_ports,
485+
'Healthcheck' => new_resource.health_check,
486+
'Hostname' => parsed_hostname,
487+
'MacAddress' => new_resource.mac_address,
488488
'NetworkDisabled' => new_resource.network_disabled,
489-
'OpenStdin' => new_resource.open_stdin,
490-
'StdinOnce' => new_resource.stdin_once,
491-
'Tty' => new_resource.tty,
492-
'User' => new_resource.user,
493-
'Volumes' => new_resource.volumes,
494-
'WorkingDir' => new_resource.working_dir,
495-
'HostConfig' => {
496-
'Binds' => new_resource.volumes_binds,
497-
'CapAdd' => new_resource.cap_add,
498-
'CapDrop' => new_resource.cap_drop,
499-
'CgroupParent' => new_resource.cgroup_parent,
500-
'CgroupnsMode' => new_resource.cgroup_ns,
501-
'CpuShares' => new_resource.cpu_shares,
502-
'CpusetCpus' => new_resource.cpuset_cpus,
503-
'Devices' => new_resource.devices,
504-
'Dns' => new_resource.dns,
505-
'DnsSearch' => new_resource.dns_search,
506-
'ExtraHosts' => new_resource.extra_hosts,
507-
'IpcMode' => new_resource.ipc_mode,
508-
'Init' => new_resource.init,
509-
'KernelMemory' => new_resource.kernel_memory,
510-
'Links' => new_resource.links,
511-
'LogConfig' => log_config,
512-
'Memory' => new_resource.memory,
513-
'MemorySwap' => new_resource.memory_swap,
489+
'OpenStdin' => new_resource.open_stdin,
490+
'StdinOnce' => new_resource.stdin_once,
491+
'Tty' => new_resource.tty,
492+
'User' => new_resource.user,
493+
'Volumes' => new_resource.volumes,
494+
'WorkingDir' => new_resource.working_dir,
495+
'HostConfig' => {
496+
'Binds' => new_resource.volumes_binds,
497+
'CapAdd' => new_resource.cap_add,
498+
'CapDrop' => new_resource.cap_drop,
499+
'CgroupParent' => new_resource.cgroup_parent,
500+
'CgroupnsMode' => new_resource.cgroup_ns,
501+
'CpuShares' => new_resource.cpu_shares,
502+
'CpusetCpus' => new_resource.cpuset_cpus,
503+
'Devices' => new_resource.devices,
504+
'Dns' => new_resource.dns,
505+
'DnsSearch' => new_resource.dns_search,
506+
'ExtraHosts' => new_resource.extra_hosts,
507+
'IpcMode' => new_resource.ipc_mode,
508+
'Init' => new_resource.init,
509+
'KernelMemory' => new_resource.kernel_memory,
510+
'Links' => new_resource.links,
511+
'LogConfig' => log_config,
512+
'Memory' => new_resource.memory,
513+
'MemorySwap' => new_resource.memory_swap,
514514
'MemorySwappiness' => new_resource.memory_swappiness,
515515
'MemoryReservation' => new_resource.memory_reservation,
516-
'NanoCpus' => new_resource.cpus,
517-
'NetworkMode' => normalize_container_network_mode(new_resource.network_mode),
518-
'OomKillDisable' => new_resource.oom_kill_disable,
519-
'OomScoreAdj' => new_resource.oom_score_adj,
520-
'Privileged' => new_resource.privileged,
521-
'PidMode' => new_resource.pid_mode,
522-
'PortBindings' => new_resource.port_bindings,
516+
'NanoCpus' => new_resource.cpus,
517+
'NetworkMode' => normalize_container_network_mode(new_resource.network_mode),
518+
'OomKillDisable' => new_resource.oom_kill_disable,
519+
'OomScoreAdj' => new_resource.oom_score_adj,
520+
'Privileged' => new_resource.privileged,
521+
'PidMode' => new_resource.pid_mode,
522+
'PortBindings' => new_resource.port_bindings,
523523
'PublishAllPorts' => new_resource.publish_all_ports,
524-
'RestartPolicy' => {
525-
'Name' => new_resource.restart_policy,
524+
'RestartPolicy' => {
525+
'Name' => new_resource.restart_policy,
526526
'MaximumRetryCount' => new_resource.restart_maximum_retry_count,
527527
},
528-
'ReadonlyRootfs' => new_resource.ro_rootfs,
529-
'Runtime' => new_resource.runtime,
530-
'SecurityOpt' => new_resource.security_opt,
531-
'ShmSize' => new_resource.shm_size,
532-
'Sysctls' => new_resource.sysctls,
533-
'Tmpfs' => new_resource.tmpfs,
534-
'Ulimits' => ulimits_to_hash,
535-
'UsernsMode' => new_resource.userns_mode,
536-
'UTSMode' => new_resource.uts_mode,
537-
'VolumesFrom' => new_resource.volumes_from,
538-
'VolumeDriver' => new_resource.volume_driver,
528+
'ReadonlyRootfs' => new_resource.ro_rootfs,
529+
'Runtime' => new_resource.runtime,
530+
'SecurityOpt' => new_resource.security_opt,
531+
'ShmSize' => new_resource.shm_size,
532+
'Sysctls' => new_resource.sysctls,
533+
'Tmpfs' => new_resource.tmpfs,
534+
'Ulimits' => ulimits_to_hash,
535+
'UsernsMode' => new_resource.userns_mode,
536+
'UTSMode' => new_resource.uts_mode,
537+
'VolumesFrom' => new_resource.volumes_from,
538+
'VolumeDriver' => new_resource.volume_driver,
539539
},
540540
}
541541
net_config = {
@@ -691,7 +691,7 @@ def validate_container_create
691691
raise Chef::Exceptions::ValidationFailed, 'restart_policy must be either no, always, unless-stopped, or on-failure.'
692692
end
693693

694-
if new_resource.autoremove == true && (new_resource.property_is_set?(:restart_policy) && new_resource.restart_policy != 'no')
694+
if new_resource.autoremove == true && new_resource.property_is_set?(:restart_policy) && new_resource.restart_policy != 'no'
695695
raise Chef::Exceptions::ValidationFailed, 'Conflicting options restart_policy and autoremove.'
696696
end
697697

resources/exec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
property :timeout, Numeric, default: 60, desired_state: false
88
property :container_obj, Docker::Container, desired_state: false
99
property :returns, [ Integer, Array ], coerce: proc { |v| Array(v) }, default: [0],
10-
description: 'The return value for a command. This may be an array of accepted values. An exception is raised when the return value(s) do not match.'
10+
description: 'The return value for a command. This may be an array of accepted values. An exception is raised when the return value(s) do not match.'
1111

1212
alias_method :cmd, :command
1313

resources/installation_package.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,12 @@ def version_string(v)
119119

120120
if v.to_f < 18.06 && !bionic?
121121
return "#{v}~ce-0~debian" if debian?
122-
return "#{v}~ce-0~ubuntu" if ubuntu?
122+
"#{v}~ce-0~ubuntu" if ubuntu?
123123
elsif v.to_f >= 23.0 && ubuntu?
124124
"5:#{v}-1~ubuntu.#{node['platform_version']}~#{codename}"
125125
elsif v.to_f >= 18.09 && debuntu?
126126
return "5:#{v}~#{test_version}-0~debian-#{codename}" if debian?
127-
return "5:#{v}~#{test_version}-0~ubuntu-#{codename}" if ubuntu?
127+
"5:#{v}~#{test_version}-0~ubuntu-#{codename}" if ubuntu?
128128
else
129129
return "#{v}~ce~#{test_version}-0~debian" if debian?
130130
return "#{v}~ce~#{test_version}-0~ubuntu" if ubuntu?

resources/partial/_base.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ def with_retries(&_block)
2727
yield
2828
# Only catch errors that can be fixed with retries.
2929
rescue Docker::Error::ServerError, # 500
30-
Docker::Error::UnexpectedResponseError, # 400
31-
Docker::Error::TimeoutError,
32-
Docker::Error::IOError
30+
Docker::Error::UnexpectedResponseError, # 400
31+
Docker::Error::TimeoutError,
32+
Docker::Error::IOError
3333
tries -= 1
3434
retry if tries > 0
3535
raise

test/cookbooks/docker_test/recipes/container.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,10 @@
311311
tag '3.1'
312312
command 'df -h'
313313
tmpfs({
314-
'/tmpfs1' => '',
315-
'/tmpfs2' => 'size=20M,uid=1000',
316-
'/tmpfs3' => 'rw,noexec,nosuid,size=50M',
317-
})
314+
'/tmpfs1' => '',
315+
'/tmpfs2' => 'size=20M,uid=1000',
316+
'/tmpfs3' => 'rw,noexec,nosuid,size=50M',
317+
})
318318
action :run_if_missing
319319
end
320320

0 commit comments

Comments
 (0)