1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

feature #863: Moved RESULT constants to base module for get_info_from_execution

This commit is contained in:
Ruben S. Montero 2011-11-22 12:09:41 +01:00
parent 122bd19678
commit 7d89b719a5
2 changed files with 11 additions and 10 deletions

View File

@ -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

View File

@ -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