class VagrantPlugins::CORL::Command::Launcher
Public Class Methods
synopsis()
click to toggle source
# File lib/core/vagrant/commands/launcher.rb 9 def self.synopsis 10 "execute CORL actions within the defined network" 11 end
Public Instance Methods
env()
click to toggle source
# File lib/core/vagrant/commands/launcher.rb 16 def env 17 @env 18 end
execute()
click to toggle source
# File lib/core/vagrant/commands/launcher.rb 23 def execute 24 # Set the base command so we can access in any actions executed 25 ::CORL::Vagrant.command = ::CORL.handle(self) 26 ::CORL.executable(ARGV - [ 'corl', '--' ], "vagrant corl") 27 end
vm_machine(name, provider = nil, refresh = false)
click to toggle source
# File lib/core/vagrant/commands/launcher.rb 32 def vm_machine(name, provider = nil, refresh = false) 33 machine = nil 34 35 # Mostly derived from Vagrant base command with_target_vms() method 36 provider = provider.to_sym if provider 37 38 env.active_machines.each do |active_name, active_provider| 39 if name == active_name 40 if provider && provider != active_provider 41 raise ::Vagrant::Errors::ActiveMachineWithDifferentProvider, 42 :name => active_name.to_s, 43 :active_provider => active_provider.to_s, 44 :requested_provider => provider.to_s 45 else 46 @logger.info("Active machine found with name #{active_name}. " + 47 "Using provider: #{active_provider}") 48 provider = active_provider 49 break 50 end 51 end 52 end 53 54 provider ||= env.default_provider 55 56 machine = env.machine(name, provider, refresh) 57 58 machine.ui.opts[:color] = :default # TODO: Something better?? 59 machine 60 end