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
This commit is contained in:
Mohammed Naser
2017-09-18 20:07:57 -04:00
parent 2e5e936595
commit 379e601c68

View File

@@ -41,7 +41,11 @@ class Puppet::Provider::Nova < Puppet::Provider::Openstack
def self.nova_manage_request(*args) def self.nova_manage_request(*args)
# Not using the nova-manage command directly, # Not using the nova-manage command directly,
# so we can disable combining of stderr/stdout output. # 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, :failonfail => true,
:combine => false, :combine => false,
:custom_environment => {} :custom_environment => {}