Sha256: 36078b542875a0f76bbfdf6f2bdcd4ed84c7f94d4ade1d45423039a6170eaf52

Contents?: true

Size: 1.22 KB

Versions: 14

Compression:

Stored size: 1.22 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')
      
      ensure_network(network) do
        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
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
corl-0.4.29 lib/CORL/action/machines.rb
corl-0.4.28 lib/CORL/action/machines.rb
corl-0.4.27 lib/CORL/action/machines.rb
corl-0.4.26 lib/CORL/action/machines.rb
corl-0.4.25 lib/CORL/action/machines.rb
corl-0.4.24 lib/CORL/action/machines.rb
corl-0.4.23 lib/CORL/action/machines.rb
corl-0.4.22 lib/CORL/action/machines.rb
corl-0.4.21 lib/CORL/action/machines.rb
corl-0.4.20 lib/CORL/action/machines.rb
corl-0.4.19 lib/CORL/action/machines.rb
corl-0.4.18 lib/CORL/action/machines.rb
corl-0.4.17 lib/CORL/action/machines.rb
corl-0.4.16 lib/CORL/action/machines.rb