From 7b21aeb2deb8a14b6550c4be48b048e20147cee9 Mon Sep 17 00:00:00 2001 From: Sergio Semedi Barranco Date: Fri, 21 Sep 2018 18:31:11 +0200 Subject: [PATCH] B #2420: tm_mad does not work using disk with brackets (#2425) (cherry picked from commit 00d800a09be0f178a06404a2c31256f398de0380) --- src/tm_mad/one_tm.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tm_mad/one_tm.rb b/src/tm_mad/one_tm.rb index 94972a78fd..a7a5a8bf08 100755 --- a/src/tm_mad/one_tm.rb +++ b/src/tm_mad/one_tm.rb @@ -31,6 +31,7 @@ end $: << RUBY_LIB_LOCATION require 'pp' +require 'shellwords' require 'OpenNebulaDriver' require 'CommandManager' require 'getoptlong' @@ -98,7 +99,7 @@ class TransferManagerDriver < OpenNebulaDriver def do_transfer_action(id, command) cmd = command[0].downcase tm = command[1] - args = command[2..-1].join(" ") + args = command[2..-1].map{|e| Shellwords.escape(e)}.join(" ") if not @types.include?(tm) return RESULT[:failure], "Transfer Driver '#{tm}' not available"