Sha256: 99450f8b2225b54bad527e0ff07ad442d72bd8187aea2e204f58764b84f4218c

Contents?: true

Size: 1.09 KB

Versions: 14

Compression:

Stored size: 1.09 KB

Contents

module CORL
module Action
class Regions < Plugin::CloudAction

  #-----------------------------------------------------------------------------
  # Settings
  
  def configure
    super do
      codes :node_load_failure,
            :region_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.regions.start')
      
      if node = network.test_node(settings[:node_provider])
        if regions = node.regions
          regions.each do |region|
            render(sprintf("> %s", region), { :prefix => false })
          end
          
          myself.result = regions
          success('corl.actions.regions.results', { :regions => regions.length }) if regions.length > 1
        else
          myself.status = code.region_load_failure
        end
      else
        myself.status = code.node_load_failure
      end
    end
  end
end
end
end

Version data entries

14 entries across 14 versions & 1 rubygems

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