Class: VagrantPlugins::GuestSmartos::Cap::RSync

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant/smartos/guest/cap/rsync.rb

Class Method Summary collapse

Class Method Details

.rsync_command(machine) ⇒ Object



9
10
11
# File 'lib/vagrant/smartos/guest/cap/rsync.rb', line 9

def self.rsync_command(machine)
  "#{machine.config.smartos.suexec_cmd} rsync"
end

.rsync_installed(machine) ⇒ Object



5
6
7
# File 'lib/vagrant/smartos/guest/cap/rsync.rb', line 5

def self.rsync_installed(machine)
  machine.communicate.test("which rsync")
end

.rsync_post(machine, opts) ⇒ Object



19
20
21
22
# File 'lib/vagrant/smartos/guest/cap/rsync.rb', line 19

def self.rsync_post(machine, opts)
  machine.communicate.execute("#{machine.config.smartos.suexec_cmd} find '#{opts[:guestpath]}' '(' ! -user #{opts[:owner]} -or ! -group #{opts[:group]} ')' -print0 | " +
      "#{machine.config.smartos.suexec_cmd} xargs -0 chown #{opts[:owner]}:#{opts[:group]}")
end

.rsync_pre(machine, opts) ⇒ Object



13
14
15
16
17
# File 'lib/vagrant/smartos/guest/cap/rsync.rb', line 13

def self.rsync_pre(machine, opts)
  machine.communicate.tap do |comm|
    comm.execute("#{machine.config.smartos.suexec_cmd} mkdir -p '#{opts[:guestpath]}'")
  end
end