Class: VagrantPlugins::ProviderZone::Command::ZloginConsole
- Inherits:
-
Object
- Object
- VagrantPlugins::ProviderZone::Command::ZloginConsole
- Defined in:
- lib/vagrant-zones/command/zlogin_console.rb
Overview
This is used to acces the zone via console, zlogin
Instance Method Summary collapse
Instance Method Details
#execute ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/vagrant-zones/command/zlogin_console.rb', line 8 def execute = {} opts = OptionParser.new do |o| o. = 'Usage: vagrant zone console zlogin [options]' o.on('--ip <host_ip>', 'Specify host IP to listen on') do |p| [:ip] = p end o.on('--port <port>', 'Specify port to listen on') do |p| [:port] = p end end argv = (opts) return unless argv unless argv.length <= 4 @env.ui.info(opts.help) return end [:port] = nil unless [:port] =~ /\d/ with_target_vms(argv, provider: :zone) do |machine| driver = machine.provider.driver detach = 'no' kill = 'no' exit = { detach: detach, kill: kill } driver.console(@env.ui, 'zlogin', [:ip], [:port], exit) end end |