changes to vnm_driver

This commit is contained in:
Javi Fontan committed 2011-11-22 11:01:18 +01:00
1 parent c061648b62
commit 9624dd4b03
2 files changed
+15 -14

No files matched your search

+3 -3
View File
@@ -78,7 +78,7 @@ module DriverExecHelper
end
end
def get_info_from_execution(command_exe)
def get_info_from_execution(command_exe)
if command_exe.code == 0
result = RESULT[:success]
info = command_exe.stdout
@@ -90,7 +90,7 @@ module DriverExecHelper
info = "-" if info == nil || info.empty?
[result, info]
end
end
# Simple parser for the config file generated by OpenNebula
def read_configuration
@@ -126,4 +126,4 @@ module DriverExecHelper
config
end
end
end
+12 -11
View File
@@ -19,21 +19,21 @@
# OpenNebula Drivers
class VirtualNetworkDriver
include DriverExecHelper
include DriverExecHelper
def initialize(directory, options={})
def initialize(directory, options={})
@options = options
@ssh_stream = options[:ssh_stream]
@options = options
@ssh_stream = options[:ssh_stream]
@message = options[:message]
@vm_encoded = Base64.encode64(@message.elements['VM'].to_s).delete("\n")
initialize_helper("vnet/#{directory}", options)
end
initialize_helper("vnet/#{directory}", options)
end
def do_action(parameters, aname)
vm_encoded = Base64.encode64(message.elements['VM'].to_s).delete("\n")
command = action_command_line(aname, @vm_encoded, options[:script_name])
def do_action(parameters, aname)
command = action_command_line(aname, @vm_encoded, options[:script_name])
if action_is_local? aname
execution = LocalCommand.run(command, log_method(id))
@@ -42,5 +42,6 @@ class VirtualNetworkDriver
end
result, info = get_info_from_execution(command_exe)
end
end
end