1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

Handle redirects in Remote hooks. Do not show command output in hook_manager

git-svn-id: http://svn.opennebula.org/one/trunk@464 3034c82b-c49b-4eb3-8279-a7acafdc01c0
This commit is contained in:
Rubén S. Montero 2009-04-10 22:04:15 +00:00
parent eb3af7219f
commit bc1809f0e8
2 changed files with 6 additions and 8 deletions

View File

@ -37,22 +37,20 @@ require 'CommandManager'
class HookManagerDriver < OpenNebulaDriver
def initialize(num)
super(num, true)
register_action(:EXECUTE, method("action_execute"))
end
def action_execute(number, hook_name, host, script, *arguments)
cmd=nil
cmd_string="#{script} #{arguments.join(' ')}"
if host.upcase=="LOCAL"
cmd=LocalCommand.run(cmd_string, log_method(number))
else
cmd=SSHCommand.run(cmd_string, host, log_method(number))
cmd=SSHCommand.run("'#{cmd_string}'", host, log_method(number))
end
pp cmd.stdout
if cmd.code==0
send_message("EXECUTE", RESULT[:success], number, hook_name)
else

View File

@ -331,7 +331,7 @@ int LibVirtDriver::deployment_description(
file << "\t\t<disk type='file' device='disk'>" << endl;
file << "\t\t\t<source file='" << vm->get_remote_dir() << "/disk."
<< num << "'/>" << endl;
file << "\t\t\t<target dev='" << target << "'/>";
file << "\t\t\t<target dev='" << target << "'/>" << endl;
file << "\t\t\t<readonly/>" << endl;
file << "\t\t</disk>" << endl;
}