From c57e10154fc75665fe26db3a43950c13e4b1fa08 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Sun, 4 Dec 2011 20:44:38 +0100 Subject: [PATCH] Make auth drivers to use LocalAction instead of do_action wrapper --- src/authm_mad/one_auth_mad.rb | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/authm_mad/one_auth_mad.rb b/src/authm_mad/one_auth_mad.rb index 245c660944..9ab1ac6bd4 100755 --- a/src/authm_mad/one_auth_mad.rb +++ b/src/authm_mad/one_auth_mad.rb @@ -108,11 +108,14 @@ class AuthDriver < OpenNebulaDriver #/var/lib/one/remotes/auth//authenticate authN_path = File.join(@local_scripts_path, driver) - command = File.join(authN_path,ACTION[:authN].downcase) + command = File.join(authN_path, ACTION[:authN].downcase) command << " '" << user.gsub("'", '\'"\'"\'') << "' '" << password.gsub("'", '\'"\'"\'') << "' " << secret - do_action(command, request_id, nil, ACTION[:authN], - :local => true) + rc = LocalCommand.run(command, log_method(request_id)) + + result , info = get_info_from_execution(rc) + + send_message(ACTION[:authN], result, request_id, info) end # Authenticate a user based in a string of the form user:secret when using the @@ -137,13 +140,16 @@ class AuthDriver < OpenNebulaDriver result = RESULT[:failure] end - send_message(ACTION[:authZ],result,request_id,"-") + send_message(ACTION[:authZ], result, request_id, "-") else command = @authZ_cmd.clone command << ' ' << user_id << ' ' << requests.join(' ') - do_action(command, request_id, nil, ACTION[:authZ], - :local => true) + rc = LocalCommand.run(command, log_method(request_id)) + + result , info = get_info_from_execution(rc) + + send_message(ACTION[:authZ], result, request_id, info) end end end