From 7d89b719a59a5f563674e5d75681331cbcee2da6 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 22 Nov 2011 12:09:41 +0100 Subject: [PATCH] feature #863: Moved RESULT constants to base module for get_info_from_execution --- src/mad/ruby/DriverExecHelper.rb | 14 +++++++++++--- src/mad/ruby/OpenNebulaDriver.rb | 7 ------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/mad/ruby/DriverExecHelper.rb b/src/mad/ruby/DriverExecHelper.rb index d857dec8ab..9ea245f8c6 100644 --- a/src/mad/ruby/DriverExecHelper.rb +++ b/src/mad/ruby/DriverExecHelper.rb @@ -16,8 +16,15 @@ # This module provides an abstraction to generate an execution context for -# OpenNebula Drivers +# OpenNebula Drivers. The module has been designed to be included as part +# of a driver and not to be used standalone. module DriverExecHelper + # Action result strings for messages + RESULT = { + :success => "SUCCESS", + :failure => "FAILURE" + } + #Initialize module variables def initialize_helper(directory, options) @config = read_configuration @@ -78,6 +85,7 @@ module DriverExecHelper end end + #This method returns the result in terms def get_info_from_execution(command_exe) if command_exe.code == 0 result = RESULT[:success] @@ -97,9 +105,9 @@ module DriverExecHelper one_config=nil if ENV['ONE_LOCATION'] - one_config=ENV['ONE_LOCATION']+'/var/config' + one_config = ENV['ONE_LOCATION']+'/var/config' else - one_config='/var/lib/one/config' + one_config = '/var/lib/one/config' end config=Hash.new diff --git a/src/mad/ruby/OpenNebulaDriver.rb b/src/mad/ruby/OpenNebulaDriver.rb index 4833d7bdd4..174e65a9db 100644 --- a/src/mad/ruby/OpenNebulaDriver.rb +++ b/src/mad/ruby/OpenNebulaDriver.rb @@ -37,13 +37,6 @@ class OpenNebulaDriver < ActionManager # @return [String] Path for scripts attr_reader :local_scripts_path, :remote_scripts_path - - # Action result strings for messages - RESULT = { - :success => "SUCCESS", - :failure => "FAILURE" - } - # Initialize OpenNebulaDriver object # # @param [String] directory path inside the remotes directory where the