Class: VagrantPlugins::CORL::Command::Launcher
- Inherits:
-
Object
- Object
- VagrantPlugins::CORL::Command::Launcher
- Includes:
- CORL::Parallel
- Defined in:
- lib/core/vagrant/commands/launcher.rb
Class Method Summary collapse
-
.synopsis ⇒ Object
—————————————————————————–.
Instance Method Summary collapse
-
#env ⇒ Object
—————————————————————————– Property accessors / modifiers.
-
#execute ⇒ Object
—————————————————————————– Execution.
-
#vm_machine(name, provider = nil, refresh = false) ⇒ Object
—————————————————————————– Utilities.
Class Method Details
.synopsis ⇒ Object
11 12 13 |
# File 'lib/core/vagrant/commands/launcher.rb', line 11 def self.synopsis "execute CORL actions within the defined network" end |
Instance Method Details
#env ⇒ Object
Property accessors / modifiers
18 19 20 |
# File 'lib/core/vagrant/commands/launcher.rb', line 18 def env @env end |
#execute ⇒ Object
Execution
25 26 27 28 29 |
# File 'lib/core/vagrant/commands/launcher.rb', line 25 def execute # Set the base command so we can access in any actions executed ::CORL::Vagrant.command = ::CORL.handle(self) ::CORL.executable(ARGV - [ 'corl', '--' ], "[ vagrant ] corl") end |
#vm_machine(name, provider = nil, refresh = false) ⇒ Object
Utilities
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/core/vagrant/commands/launcher.rb', line 34 def vm_machine(name, provider = nil, refresh = false) machine = nil # Mostly derived from Vagrant base command with_target_vms() method provider = provider.to_sym if provider env.active_machines.each do |active_name, active_provider| if name == active_name if provider && provider != active_provider raise ::Vagrant::Errors::ActiveMachineWithDifferentProvider, :name => active_name.to_s, :active_provider => active_provider.to_s, :requested_provider => provider.to_s else @logger.info("Active machine found with name #{active_name}. " + "Using provider: #{active_provider}") provider = active_provider break end end end provider ||= env.default_provider machine = env.machine(name, provider, refresh) machine.ui.opts[:color] = :default # TODO: Something better?? machine end |