Skip to content

Commit cf9ad8e

Browse files
authored
Merge pull request #8 from olivierlemasle/fix-systtempl
Revert 44fcb3b8 for system_template.rb
2 parents cf45b2c + e84bdbe commit cf9ad8e

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

libraries/system_template.rb

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,20 @@ def get_template_id
3030
Chef::Log.debug "template id = #{template_id.stdout.chomp}"
3131
return template_id.stdout.chomp
3232
end
33-
34-
33+
3534
# Create or mount secondary storage path
3635
def secondary_storage
37-
directory @current_resource.nfs_path do
38-
owner "root"
39-
group "root"
40-
action :create
41-
recursive true
42-
not_if { ::File.exist?(@current_resource.nfs_path)}
36+
unless ::File.exist?(@current_resource.nfs_path)
37+
# Use condition enclosing instead of "not_if" guard because resource nfs_path is not defined in case of resource merging
38+
directory @current_resource.nfs_path do
39+
owner "root"
40+
group "root"
41+
action :create
42+
recursive true
43+
end
4344
end
4445
end
45-
46+
4647
def download_systemvm_template
4748
# Create database configuration for cloudstack management server that will use and existing database.
4849
#puts "Downloading system template from: #{@current_resource.url}"

0 commit comments

Comments
 (0)