lib/testlab/provisioners/nfs_mount.rb in testlab-1.20.4 vs lib/testlab/provisioners/nfs_mount.rb in testlab-1.20.5
- old
+ new
@@ -53,20 +53,27 @@
alias :on_container_destroy :on_container_deprovision
private
def add_nfs_mounts(container)
- @command.exec(<<-EOF)
-set -x
+ script = <<-EOF
#{service_check}
grep '#{def_tag(container)}' /etc/exports && exit 0
cat <<EOI | #{sudo} tee -a /etc/exports
#{def_tag(container)}
#{mount_blob(container)}
#{end_tag(container)}
EOI
#{restart_service_command}
EOF
+
+ tempfile = Tempfile.new('script')
+ tempfile.write(script)
+ tempfile.flush
+
+ command = %(/bin/bash -x #{tempfile.path})
+
+ @command.exec(command)
end
def remove_nfs_mounts(container)
@command.exec(sed_exports(container))
end