Class: VagrantPlugins::Deltacloud::Action::SyncFolders

Inherits:
AbstractAction
  • Object
show all
Defined in:
lib/vagrant-deltacloud-provider/action/sync_folders.rb

Instance Method Summary collapse

Methods inherited from AbstractAction

#call

Constructor Details

#initialize(app, _env) ⇒ SyncFolders

Returns a new instance of SyncFolders.



12
13
14
# File 'lib/vagrant-deltacloud-provider/action/sync_folders.rb', line 12

def initialize(app, _env)
  @app = app
end

Instance Method Details

#execute(env) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/vagrant-deltacloud-provider/action/sync_folders.rb', line 16

def execute(env)
  env[:deltacloud_client] = Deltacloud::DeltacloudClient.instance
  sync_method = env[:machine].provider_config.sync_method
  ssh_disabled = env[:machine].provider_config.ssh_disabled
  if sync_method == 'none' || ssh_disabled
    NoSyncFolders.new(@app, env, ssh_disabled).call(env)
  elsif sync_method == 'rsync'
    RsyncFolders.new(@app, env).call(env)
  else
    fail Errors::SyncMethodError, sync_method_value: sync_method
  end
end