bloomberg/chef-bcpc — pull request #418 by mihalis68 (2014-12-15 17:57:06+00:00)
Title: protect against ceph not being configured yet

This is a check that /var/run/chef exists. The diff is non-scary if done whitespace independent, in which case it looks like

```
diff --git a/cookbooks/bcpc/providers/cephconfig.rb b/cookbooks/bcpc/providers/cephconfig.rb
index 66b383a..d36bf3a 100644
--- a/cookbooks/bcpc/providers/cephconfig.rb
+++ b/cookbooks/bcpc/providers/cephconfig.rb
@@ -22,6 +22,7 @@ def whyrun_supported?
end

action :set do
+ if Dir.exists?(@new_resource.path)
Dir.chdir(@new_resource.path)
f = Dir.glob((@new_resource.target) +".asok")
f.each do |asok|
@@ -46,6 +47,9 @@ action :set do
raise "Ceph target \"#{@new_resource.path}/#{asok}\" doesn't have the config value #{new_resource.name}"
end
end
+ else
+ Chef::Log.info("Ceph directory \"#{@new_resource.path}\" doesn't exist!")
+ end
end

```