M #-: Fix for local steps in vCenter

This commit is contained in:
Tino Vazquez committed 2020-11-06 10:23:09 +01:00
1 parent e58eae6c66
commit aa78acf67e
2 files changed
+20 -10

No files matched your search

+3 -1
View File
@@ -98,7 +98,9 @@ class OpenNebulaDriver < ActionManager
params = "#{params} #{id} #{host}" unless options[:no_extra_params]
command = action_command_line(aname, params, options[:script_name])
if action_is_local?(aname)
# if options[:is_local] is not specified (nil)
# we rely uniquely in actions_is_local?
if action_is_local?(aname) or options[:is_local]
stdin = Base64.strict_encode64(options[:stdin].to_s)
execution = LocalCommand.run(command,
log_method(id),
+17 -9
View File
@@ -235,7 +235,8 @@ class VmmAction
:ssh_stream => ssh,
:respond => false,
:stdin => stdin,
:no_extra_params => no_extra_params)
:no_extra_params => no_extra_params,
:is_local => step[:is_local])
when :vnm
if step[:destination]
vnm = @vnm_dst
@@ -386,7 +387,9 @@ class ExecDriver < VirtualMachineDriver
domain = File.read(local_dfile)
if action_is_local?(:deploy)
is_action_local = action_is_local?(:deploy)
if is_action_local
dfile = action.data[:local_dfile]
else
dfile = action.data[:remote_dfile]
@@ -410,7 +413,7 @@ class ExecDriver < VirtualMachineDriver
}
end
vm_dir=File.dirname(action.data[:remote_dfile])
vm_dir=File.dirname(dfile)
steps.concat([
# Execute pre-boot networking setup
@@ -421,19 +424,24 @@ class ExecDriver < VirtualMachineDriver
# Make vm_dir, store vm.xml and ds.xml
{
:driver => :vmm,
:action => "/bin/mkdir -p",
:parameters => [vm_dir]
:driver => :vmm,
:action => "/bin/mkdir -p",
:is_local => is_action_local,
:stdin => "",
:no_extra_params => true,
:parameters => [vm_dir]
},
{
:driver => :vmm,
:action => "/bin/cat - >#{vm_dir}/vm.xml",
:stdin => xml_data.elements['VM'].to_s,
:driver => :vmm,
:action => "/bin/cat - >#{vm_dir}/vm.xml",
:is_local => is_action_local,
:stdin => xml_data.elements['VM'].to_s,
:no_extra_params => true
},
{
:driver => :vmm,
:action => "/bin/cat - >#{vm_dir}/ds.xml",
:is_local => is_action_local,
:stdin => xml_data.elements['DATASTORE'].to_s,
:no_extra_params => true
},