Module: Veewee::Provider::Core::Helper::Comm

Included in:
Box
Defined in:
lib/veewee/provider/core/helper/comm.rb

Instance Method Summary collapse

Instance Method Details

#comm_execute(host, command, options = { :progress => "on"}) ⇒ Object


34
35
36
37
38
39
40
41
# File 'lib/veewee/provider/core/helper/comm.rb', line 34

def comm_execute(host,command, options = { :progress => "on"} )
  case comm_method
  when :winrm
    winrm_execute(host,command, options )
  when :ssh
    ssh_execute(host,command, options )
  end
end

#comm_methodObject


8
9
10
11
12
13
14
# File 'lib/veewee/provider/core/helper/comm.rb', line 8

def comm_method
  if (definition.winrm_user && definition.winrm_password)
    :winrm
  else
    :ssh
  end
end

#comm_transfer_file(host, filename, destination = '.', options = {}) ⇒ Object


25
26
27
28
29
30
31
32
# File 'lib/veewee/provider/core/helper/comm.rb', line 25

def comm_transfer_file(host,filename,destination = '.' , options = {})
  case comm_method
  when :winrm
    winrm_transfer_file(host,filename,destination,options)
  when :ssh
    ssh_transfer_file(host,filename,destination,options)
  end
end

#when_comm_login_works(ip = "127.0.0.1", options = { }, &block) ⇒ Object


16
17
18
19
20
21
22
23
# File 'lib/veewee/provider/core/helper/comm.rb', line 16

def (ip="127.0.0.1", options = {  } , &block)
  case comm_method
  when :winrm
    (ip,options,block)
  when :ssh
    (ip,options,block)
  end
end