Sha256: a0e4e4ad4a4c2943fb0d463ab47d8cbe16a408582f6f408fa6f12b2b060a0121

Contents?: true

Size: 1.15 KB

Versions: 15

Compression:

Stored size: 1.15 KB

Contents

module CORL
module Action
class Machines < Plugin::CloudAction

  #-----------------------------------------------------------------------------
  # Settings
  
  def configure
    super do
      codes :node_load_failure,
            :machine_load_failure
    end
  end
  
  #---
  
  def ignore
    node_ignore - [ :node_provider ]
  end
  
  def arguments
    [ :node_provider ]
  end
  
  #-----------------------------------------------------------------------------
  # Operations
  
  def execute
    super do |local_node, network|
      info('corl.actions.machines.start')
      
      if node = network.test_node(settings[:node_provider])
        if machine_types = node.machine_types
          machine_types.each do |machine_type|
            render(node.render_machine_type(machine_type), { :prefix => false })
          end
          
          myself.result = machine_types
          success('corl.actions.machines.results', { :machines => machine_types.length }) if machine_types.length > 1
        else
          myself.status = code.machine_load_failure
        end
      else
        myself.status = code.node_load_failure
      end
    end
  end
end
end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
corl-0.4.15 lib/CORL/action/machines.rb
corl-0.4.14 lib/CORL/action/machines.rb
corl-0.4.13 lib/CORL/action/machines.rb
corl-0.4.12 lib/CORL/action/machines.rb
corl-0.4.11 lib/CORL/action/machines.rb
corl-0.4.10 lib/CORL/action/machines.rb
corl-0.4.9 lib/CORL/action/machines.rb
corl-0.4.8 lib/CORL/action/machines.rb
corl-0.4.7 lib/CORL/action/machines.rb
corl-0.4.6 lib/CORL/action/machines.rb
corl-0.4.5 lib/CORL/action/machines.rb
corl-0.4.4 lib/CORL/action/machines.rb
corl-0.4.3 lib/CORL/action/machines.rb
corl-0.4.2 lib/CORL/action/machines.rb
corl-0.4.1 lib/CORL/action/machines.rb