summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Workman <me@workmad3.com>2014-09-03 15:36:01 +0100
committerDavid Workman <me@workmad3.com>2014-09-03 15:36:01 +0100
commitf1de2a538ba8b89bdcb24de168db0b99cb0cc8fb (patch)
tree3266c28dce52fe3ffab1152deeeca9f6213194fd
parentb6f92cf2eac4a8056d8594a94aa026b69e348386 (diff)
downloadchef-f1de2a538ba8b89bdcb24de168db0b99cb0cc8fb.tar.gz
Update apply.rb
File.exist? throws an exception if file_name is nil instead of "". Use .to_s to normalise file_name to a string rather than have an explicit nil check.
-rw-r--r--lib/chef/application/apply.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/application/apply.rb b/lib/chef/application/apply.rb
index ab35b35389..f2dd2cb586 100644
--- a/lib/chef/application/apply.rb
+++ b/lib/chef/application/apply.rb
@@ -92,7 +92,7 @@ class Chef::Application::Apply < Chef::Application
end
def read_recipe_file(file_name)
- recipe_path = file_name
+ recipe_path = file_name.to_s
unless File.exist?(recipe_path)
Chef::Application.fatal!("No file exists at #{recipe_path}", 1)
end