summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Brown <andrew.brown@shopify.com>2016-05-30 12:18:56 -0400
committerAndrew Brown <andrew.brown@shopify.com>2016-05-30 12:22:35 -0400
commit75ace978d070f2f8923f40c328ea594cd505cafb (patch)
tree31129c597e82391caedaa71e573be89d397c7ff4
parentd8014435565ce81b961dde09b5b801e24d5c2d42 (diff)
downloadchef-75ace978d070f2f8923f40c328ea594cd505cafb.tar.gz
Style fixes
Fixing rubocop errors found during CI
-rw-r--r--lib/chef/dsl/platform_introspection.rb2
-rw-r--r--lib/chef/resource/file.rb5
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/chef/dsl/platform_introspection.rb b/lib/chef/dsl/platform_introspection.rb
index 679b702383..4ccdb34981 100644
--- a/lib/chef/dsl/platform_introspection.rb
+++ b/lib/chef/dsl/platform_introspection.rb
@@ -255,7 +255,7 @@ class Chef
# true:: if the current node is a docker container
# false:: if the current node is not a docker container
def docker?(node)
- ::File.exist?('/.dockerinit') || ::File.exist?('/.dockerenv')
+ ::File.exist?("/.dockerinit") || ::File.exist?("/.dockerenv")
end
end
diff --git a/lib/chef/resource/file.rb b/lib/chef/resource/file.rb
index 27a867d869..b8c7bb73e9 100644
--- a/lib/chef/resource/file.rb
+++ b/lib/chef/resource/file.rb
@@ -50,8 +50,7 @@ class Chef
allowed_actions :create, :delete, :touch, :create_if_missing
property :path, String, name_property: true, identity: true
- property :atomic_update, [ true, false ], desired_state: false,
- default: lazy { |r| r.docker?(r.node) && r.special_docker_files?(r.path) ? false : Chef::Config[:file_atomic_update] }
+ property :atomic_update, [ true, false ], desired_state: false, default: lazy { |r| r.docker?(r.node) && r.special_docker_files?(r.path) ? false : Chef::Config[:file_atomic_update] }
property :backup, [ Integer, false ], desired_state: false, default: 5
property :checksum, [ /^[a-zA-Z0-9]{64}$/, nil ]
property :content, [ String, nil ], desired_state: false
@@ -82,7 +81,7 @@ class Chef
end
def special_docker_files?(file)
- %w(/etc/hostname /etc/resolv.conf).include?(Pathname(file).cleanpath.to_path)
+ %w{/etc/hostname /etc/resolv.conf}.include?(Pathname(file).cleanpath.to_path)
end
end
end