add None check for variable node[local_repo]

Change-Id: Ia8b5c6542b2ea18c888eb2d4479144cb19a7e584
This commit is contained in:
grace.yu 2014-10-03 15:56:13 -07:00
parent d1791263a1
commit 70e4160abd
3 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ node['mysql']['client']['packages'].each do |name|
resources("package[#{name}]").run_action(:install)
end
if node['local_repo'] == ""
if node['local_repo'].nil? or node['local_repo'] == ""
chef_gem 'mysql'
else
gem_package 'mysql' do

View File

@ -26,7 +26,7 @@ if node['openstack']['image']['syslog']['use']
include_recipe 'openstack-common::logging'
end
if node['local_repo'] != ""
unless node['local_repo'].nil? or node['local_repo'] == ""
node.override['openstack']['image']['upload_image']['cirros'] = "#{node['local_repo']}/cirros-0.3.2-x86_64-disk.img"
end

View File

@ -31,7 +31,7 @@ def whyrun_supported?
end
action :create do
if node['local_repo'] == ""
if node['local_repo'].nil? or node['local_repo'] == ""
# Hack around the lack of "use_inline_resources" before Chef 11 by
# uniquely naming the execute[yum-makecache] resources. Set the
# notifies timing to :immediately for the same reasons. Remove both