From e84bdbe068e1c92965eb14cb1b1169bc5c17a3ea Mon Sep 17 00:00:00 2001 From: Olivier Lemasle Date: Sat, 24 Sep 2016 22:49:39 +0200 Subject: [PATCH] Revert 44fcb3b8 for system_template.rb current_resource.nfs_path is not defined in "not_if" guard if the resource is merged with an other "directory" resource on the same path, used during NFS share. --- libraries/system_template.rb | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/libraries/system_template.rb b/libraries/system_template.rb index 79e6a98..bd65562 100644 --- a/libraries/system_template.rb +++ b/libraries/system_template.rb @@ -30,19 +30,20 @@ def get_template_id Chef::Log.debug "template id = #{template_id.stdout.chomp}" return template_id.stdout.chomp end - - + # Create or mount secondary storage path def secondary_storage - directory @current_resource.nfs_path do - owner "root" - group "root" - action :create - recursive true - not_if { ::File.exist?(@current_resource.nfs_path)} + unless ::File.exist?(@current_resource.nfs_path) + # Use condition enclosing instead of "not_if" guard because resource nfs_path is not defined in case of resource merging + directory @current_resource.nfs_path do + owner "root" + group "root" + action :create + recursive true + end end end - + def download_systemvm_template # Create database configuration for cloudstack management server that will use and existing database. #puts "Downloading system template from: #{@current_resource.url}"