Class: Nucleon::Action::Network::Machines
- Inherits:
-
Object
- Object
- Nucleon::Action::Network::Machines
- Defined in:
- lib/nucleon/action/network/machines.rb
Class Method Summary collapse
-
.describe ⇒ Object
—————————————————————————– Info.
Instance Method Summary collapse
- #arguments ⇒ Object
-
#configure ⇒ Object
—————————————————————————– Settings.
-
#execute ⇒ Object
—————————————————————————– Operations.
-
#ignore ⇒ Object
—.
- #node_config ⇒ Object
Class Method Details
.describe ⇒ Object
Info
10 11 12 |
# File 'lib/nucleon/action/network/machines.rb', line 10 def self.describe super(:network, :machines, 860) end |
Instance Method Details
#arguments ⇒ Object
35 36 37 |
# File 'lib/nucleon/action/network/machines.rb', line 35 def arguments [ :node_provider ] end |
#configure ⇒ Object
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 |
#execute ⇒ Object
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| (: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 |
#ignore ⇒ Object
31 32 33 |
# File 'lib/nucleon/action/network/machines.rb', line 31 def ignore node_ignore - [ :node_provider ] end |
#node_config ⇒ Object
24 25 26 27 |
# File 'lib/nucleon/action/network/machines.rb', line 24 def node_config super config[:node_provider].default = nil end |