lib/testlab/container/io.rb in testlab-1.0.1 vs lib/testlab/container/io.rb in testlab-1.1.0

- old
+ new

@@ -23,11 +23,11 @@ local_file ||= File.join(Dir.pwd, File.basename(remote_file)) local_file = File.expand_path(local_file) root_fs_path = self.lxc.fs_root.split(File::SEPARATOR).last please_wait(:ui => @ui, :message => format_object_action(self, 'Compress', :cyan)) do - self.node.ssh.bootstrap(<<-EOF) + self.node.bootstrap(<<-EOF) set -x set -e du -sh #{self.lxc.container_root} @@ -39,11 +39,11 @@ EOF end please_wait(:ui => @ui, :message => format_object_action(self, 'Export', :cyan)) do File.exists?(local_file) and FileUtils.rm_f(local_file) - self.node.ssh.download(remote_file, local_file) + self.node.download(remote_file, local_file) end @ui.stdout.puts @ui.stdout.puts("Your shipping container is now exported and available at '#{local_file}'!".green.bold) @ui.stdout.puts @@ -68,16 +68,16 @@ remote_file = File.join("", "tmp", remote_filename) local_file = File.expand_path(local_file) root_fs_path = self.lxc.fs_root.split(File::SEPARATOR).last please_wait(:ui => @ui, :message => format_object_action(self, 'Import', :cyan)) do - self.node.ssh.exec(%(sudo rm -fv #{remote_file}), :silence => true, :ignore_exit_status => true) - self.node.ssh.upload(local_file, remote_file) + self.node.exec(%(sudo rm -fv #{remote_file}), :silence => true, :ignore_exit_status => true) + self.node.upload(local_file, remote_file) end please_wait(:ui => @ui, :message => format_object_action(self, 'Expand', :cyan)) do - self.node.ssh.bootstrap(<<-EOF) + self.node.bootstrap(<<-EOF) set -x set -e ls -lah #{remote_file} @@ -115,12 +115,12 @@ target_container.demolish target_container.create self.down please_wait(:ui => @ui, :message => format_object_action(self, 'Copy', :yellow)) do - self.node.ssh.exec(%(sudo rm -rf #{target_container.lxc.fs_root})) - self.node.ssh.exec(%(sudo rsync -a #{self.lxc.fs_root} #{target_container.lxc.container_root})) - self.node.ssh.exec(%(sudo rm -fv #{File.join(self.lxc.fs_root, '.*provision')})) + self.node.exec(%(sudo rm -rf #{target_container.lxc.fs_root})) + self.node.exec(%(sudo rsync -a #{self.lxc.fs_root} #{target_container.lxc.container_root})) + self.node.exec(%(sudo rm -fv #{File.join(self.lxc.fs_root, '.*provision')})) end # bring the source container back online if it was running before the copy operation (source_state == :running) and self.up