mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-12 09:17:41 +03:00
changes to vnm_driver
This commit is contained in:
parent
c061648b62
commit
9624dd4b03
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user