Class: CORL::Action::Exec
- Inherits:
-
Plugin::CloudAction
- Object
- Plugin::CloudAction
- CORL::Action::Exec
- Defined in:
- lib/CORL/action/exec.rb
Instance Method Summary collapse
-
#arguments ⇒ Object
—.
-
#configure ⇒ Object
—————————————————————————- Settings.
-
#execute ⇒ Object
—————————————————————————– Operations.
Methods inherited from Plugin::CloudAction
#ensure_network, #ensure_node, #execute_remote, #init_network, #namespace, #node_config, #node_exec, #node_ignore, #validate
Instance Method Details
#arguments ⇒ Object
17 18 19 |
# File 'lib/CORL/action/exec.rb', line 17 def arguments [ :command ] end |
#configure ⇒ Object
Settings
9 10 11 12 13 |
# File 'lib/CORL/action/exec.rb', line 9 def configure super do register :command, :array, nil end end |
#execute ⇒ Object
Operations
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/CORL/action/exec.rb', line 24 def execute super do |node, network| ensure_node(node) do if settings[:command].length > 1 settings[:command].collect! do |value| if value.strip.match(/\s+/) value = "\"#{value}\"" end value end end command_str = settings[:command].join(' ') result = node.exec({ :commands => [ command_str ] }).first myself.status = result.status end end end |