From 379e601c6873501818a5ce6033abefb9afde121b Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Mon, 18 Sep 2017 20:07:57 -0400 Subject: [PATCH] Pass arguments as array for nova-manage provider The arguments were provided as a string which would result in mangling if there are any symbols in the arguments. This patch changes the behaviour to pass an array which will prevent any of those issues. Closes-Bug: #1717545 Change-Id: I9c87072aaa218658b943c1ee30caa448aae8bdd7 --- lib/puppet/provider/nova.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/puppet/provider/nova.rb b/lib/puppet/provider/nova.rb index 6484cc05b..09b875170 100644 --- a/lib/puppet/provider/nova.rb +++ b/lib/puppet/provider/nova.rb @@ -41,7 +41,11 @@ class Puppet::Provider::Nova < Puppet::Provider::Openstack def self.nova_manage_request(*args) # Not using the nova-manage command directly, # so we can disable combining of stderr/stdout output. - Puppet::Util::Execution.execute("#{Puppet::Util.which('nova-manage')} #{args.join(' ')}", { + args.unshift(Puppet::Util.which('nova-manage')) + + # NOTE(mnaser): We pass the arguments as an array to avoid problems with + # symbols in the arguments breaking things. + Puppet::Util::Execution.execute(args, { :failonfail => true, :combine => false, :custom_environment => {}