Class: Dopi::Command::Mco::Rpc
Instance Attribute Summary
#hash, #is_verify_command, #node
Instance Method Summary
collapse
#check_exit_code, #expect_exit_codes, #validate_exit_code
create_plugin_instance, delete_plugin_default, delete_plugin_defaults, inherited, #initialize, #load_state, #merged_hash, #meta_run, #meta_valid?, plugin_defaults, set_plugin_defaults, #state_hash, wipe_plugin_defaults
Methods included from State
#delete_on_signal, #on_signal, #reset_signals, #send_signal, #signal_procs, #signals, #state, #state_add_child, #state_auto_evaluate_children, #state_auto_evaluate_children=, #state_changed, #state_children, #state_children_done?, #state_children_failed?, #state_children_partial?, #state_children_ready?, #state_children_running?, #state_children_running_noop?, #state_children_starting?, #state_done?, #state_fail, #state_failed?, #state_finish, #state_partial?, #state_ready, #state_ready?, #state_reset, #state_reset_with_children, #state_run, #state_run_noop, #state_running?, #state_running_noop?, #state_start, #state_starting?, #to_yaml_properties, #update, #update_mutex
Constructor Details
This class inherits a constructor from Dopi::Command
Instance Method Details
#action ⇒ Object
62
63
64
65
|
# File 'lib/dopi/command/mco/rpc.rb', line 62
def action
@action ||= action_valid? ?
hash[:action] : nil
end
|
#agent ⇒ Object
51
52
53
54
|
# File 'lib/dopi/command/mco/rpc.rb', line 51
def agent
@agent ||= agent_valid? ?
hash[:agent] : nil
end
|
#arguments ⇒ Object
67
68
69
70
|
# File 'lib/dopi/command/mco/rpc.rb', line 67
def arguments
@arguments ||= arguments_valid? ?
hash[:arguments] : {}
end
|
#options ⇒ Object
56
57
58
59
60
|
# File 'lib/dopi/command/mco/rpc.rb', line 56
def options
@options ||= options_valid? ?
options_defaults.merge(hash[:options]) :
options_defaults
end
|
#run ⇒ Object
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/dopi/command/mco/rpc.rb', line 26
def run
result_ok = true
flags = {
:configfile => DopCommon.config.mco_config,
:options => options,
:exit_on_failure => false
}
mc = rpcclient(agent, flags)
results = mc.custom_request(action, arguments, [@node.name], {'identity' => @node.name})
if results.empty?
log(:error, "No answer from node recieved")
result_ok = false
else
result_ok = false unless parse_mco_result(results.first)
end
mc.disconnect
result_ok
end
|
#run_noop ⇒ Object
45
46
47
48
49
|
# File 'lib/dopi/command/mco/rpc.rb', line 45
def run_noop
log(:info, "(NOOP) command #{name}: agent: #{agent}")
log(:info, "(NOOP) command #{name}: options: #{options}")
log(:info, "(NOOP) command #{name}: arguments: #{arguments}")
end
|