lib/soloist/chef_config_generator.rb in soloist-0.0.5 vs lib/soloist/chef_config_generator.rb in soloist-0.0.6
- old
+ new
@@ -10,12 +10,14 @@
def merge_env_variable_switches
return unless @hash["env_variable_switches"]
@hash["env_variable_switches"].keys.each do |variable|
sub_hash = @hash["env_variable_switches"][variable][ENV[variable]]
if sub_hash && sub_hash["recipes"]
+ @hash["recipes"] ||= []
@hash["recipes"] = (@hash["recipes"] + sub_hash["recipes"]).uniq
end
if sub_hash && sub_hash["cookbook_paths"]
+ @hash["cookbook_paths"] ||= []
@hash["cookbook_paths"] = (@hash["cookbook_paths"] + sub_hash["cookbook_paths"]).uniq
end
end
end
\ No newline at end of file