Class: Vagrant::Smartos::Zones::Command::GlobalZone

Inherits:
Object
  • Object
show all
Includes:
MultiCommand
Defined in:
lib/vagrant/smartos/zones/commands/global_zone.rb

Constant Summary collapse

COMMANDS =
%w(ssh)
OPTION_PARSER =
OptionParser.new do |o|
  o.banner = 'Usage: vagrant global-zone [command]'
  o.separator ''
  o.separator 'Commands:'
  o.separator '  ssh        ssh into the global zone'
  o.separator ''
  o.separator 'Options:'
  o.separator ''
end

Class Method Summary collapse

Instance Method Summary collapse

Methods included from MultiCommand

#execute, #fail_options!, #option_parser, #process_subcommand, #subcommands

Class Method Details

.synopsisObject



25
26
27
# File 'lib/vagrant/smartos/zones/commands/global_zone.rb', line 25

def self.synopsis
  'View and interact with the SmartOS global zone'
end

Instance Method Details

#ssh(*_args) ⇒ Object



29
30
31
32
33
34
# File 'lib/vagrant/smartos/zones/commands/global_zone.rb', line 29

def ssh(*_args)
  with_target_vms('default', single_target: true) do |machine|
    ssh_info = Util::GlobalZone::SSHInfo.new(machine.provider, machine.config, machine.env).to_hash
    Vagrant::Util::SSH.exec(ssh_info)
  end
end