From c55b6c1ed60bc689d9fbae376c90a2cf0d88f8d9 Mon Sep 17 00:00:00 2001 From: Vlastimil Holer Date: Mon, 18 Feb 2019 15:58:05 +0100 Subject: [PATCH] development: Fix "scp: error: unexpected filename: ." (#2959) --- src/im_mad/im_exec/one_im_exec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/im_mad/im_exec/one_im_exec.rb b/src/im_mad/im_exec/one_im_exec.rb index 8dfcc78b58..c10a97f0da 100755 --- a/src/im_mad/im_exec/one_im_exec.rb +++ b/src/im_mad/im_exec/one_im_exec.rb @@ -73,6 +73,17 @@ class InformationManagerDriver < OpenNebulaDriver if !action_is_local?(:MONITOR) if do_update == "1" || @options[:force_copy] + # Recreate dir for remote scripts + mkdir_cmd = "mkdir -p #{@remote_scripts_base_path}" + + cmd = SSHCommand.run(mkdir_cmd, host, log_method(number)) + + if cmd.code!=0 + send_message('MONITOR', RESULT[:failure], number, + 'Could not update remotes') + return + end + # Use SCP to sync: sync_cmd = "scp -r #{@local_scripts_base_path}/* " \ "#{host}:#{@remote_scripts_base_path}"