Module: Veewee::Provider::Core::Helper::Comm
- Included in:
- Box
- Defined in:
- lib/veewee/provider/core/helper/comm.rb
Instance Method Summary collapse
- #comm_execute(host, command, options = { :progress => "on"}) ⇒ Object
- #comm_method ⇒ Object
- #comm_transfer_file(host, filename, destination = '.', options = {}) ⇒ Object
- #when_comm_login_works(ip = "127.0.0.1", options = { }, &block) ⇒ Object
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, = { :progress => "on"} ) case comm_method when :winrm winrm_execute(host,command, ) when :ssh ssh_execute(host,command, ) end end |
#comm_method ⇒ Object
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 = '.' , = {}) case comm_method when :winrm winrm_transfer_file(host,filename,destination,) when :ssh ssh_transfer_file(host,filename,destination,) 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 when_comm_login_works(ip="127.0.0.1", = { } , &block) case comm_method when :winrm when_winrm_login_works(ip,,block) when :ssh when_ssh_login_works(ip,,block) end end |