Fix the argument order for openstack client
If there are --xxx argument placed for openstack clients such as nova, glance, keystone etc, these arguments need to be placed before the actual command line. Otherwise, the client will raise unrecognized arguments exception which will make the command execution fail. Change-Id: I1568f9332accffdfa3a34d8bbd842f707b1a340e Closes-Bug: #1388147
This commit is contained in:
		| @@ -54,10 +54,11 @@ module ::Openstack # rubocop:disable Documentation | ||||
|     #       array into [cmd].  This is done to accomdate cmd + options like: | ||||
|     #       keystone user-list | ||||
|     #       glance   image-show <id|name> | ||||
|     openstackcmd = [cmd].concat(options.split) | ||||
|     openstackcmd = [cmd] | ||||
|     args.each do |key, val| | ||||
|       openstackcmd << "--#{key}" << val.to_s | ||||
|     end | ||||
|     openstackcmd = openstackcmd.concat(options.split) | ||||
|     Chef::Log.debug("Running openstack command: #{openstackcmd} with environment: #{env}") | ||||
|     result = shell_out(openstackcmd, env: env) | ||||
|     fail "#{result.stderr} (#{result.exitstatus})" if result.exitstatus != 0 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 ZHU ZHU
					ZHU ZHU