Class: Nucleon::Action::Network::Machines

Inherits:
Object
  • Object
show all
Defined in:
lib/nucleon/action/network/machines.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.describeObject


Info



10
11
12
# File 'lib/nucleon/action/network/machines.rb', line 10

def self.describe
  super(:network, :machines, 860)
end

Instance Method Details

#argumentsObject



35
36
37
# File 'lib/nucleon/action/network/machines.rb', line 35

def arguments
  [ :node_provider ]
end

#configureObject


Settings



17
18
19
20
21
22
# File 'lib/nucleon/action/network/machines.rb', line 17

def configure
  super do
    codes :node_load_failure,
          :machine_load_failure
  end
end

#executeObject


Operations



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/nucleon/action/network/machines.rb', line 42

def execute
  super do |local_node|
    ensure_network do
      if node = network.test_node(settings[:node_provider])
        if machine_types = node.machine_types
          machine_types.each do |machine_type|
            prefixed_message(:info, '  ', node.render_machine_type(machine_type), { :i18n => false, :prefix => false })
          end

          myself.result = machine_types
          success('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

#ignoreObject




31
32
33
# File 'lib/nucleon/action/network/machines.rb', line 31

def ignore
  node_ignore - [ :node_provider ]
end

#node_configObject



24
25
26
27
# File 'lib/nucleon/action/network/machines.rb', line 24

def node_config
  super
  config[:node_provider].default = nil
end