Skip to content

Commit

Permalink
Merge pull request sous-chefs#1133 from chef-cookbooks/cookstyle_bot/…
Browse files Browse the repository at this point in the history
…cookstyle_6_18_8

Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 authored Sep 17, 2020
2 parents b56ae4e + 22206a8 commit 9441f6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions libraries/docker_container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def coerce_links(v)
when DockerBase::UnorderedArray, nil
v
else
return nil if v.empty?
return if v.empty?
# Parse docker input of /source:/container_name/dest into source:dest
DockerBase::UnorderedArray.new(Array(v)).map! do |link|
if link =~ %r{^/(?<source>.+):/#{name}/(?<dest>.+)}
Expand Down Expand Up @@ -732,7 +732,7 @@ def validate_container_create
end

def parsed_hostname
return nil if new_resource.network_mode == 'host'
return if new_resource.network_mode == 'host'
new_resource.hostname
end

Expand All @@ -746,7 +746,7 @@ def state
end

def ulimits_to_hash
return nil if new_resource.ulimits.nil?
return if new_resource.ulimits.nil?
new_resource.ulimits.map do |u|
name = u.split('=')[0]
soft = u.split('=')[1].split(':')[0]
Expand Down
4 changes: 2 additions & 2 deletions libraries/helpers_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def installed_docker_version
end

def connect_host
return nil unless host
return unless host
sorted = coerce_host(host).sort do |a, b|
c_a = 1 if a =~ /^unix:/
c_a = 2 if a =~ /^fd:/
Expand All @@ -76,7 +76,7 @@ def connect_host

def connect_socket
return "/var/run/#{docker_name}.sock" unless host
return nil if host.grep(%r{unix://|fd://}).empty?
return if host.grep(%r{unix://|fd://}).empty?
sorted = coerce_host(host).sort do |a, b|
c_a = 1 if a =~ /^unix:/
c_a = 2 if a =~ /^fd:/
Expand Down

0 comments on commit 9441f6f

Please sign in to comment.