Commit 2c42e1d6 authored by Zachary Stevens's avatar Zachary Stevens Committed by Bryan McLellan
Browse files

[CHEF-3489] Permit whitespace in chef-client's -o argument.

parent 07d15b16
......@@ -447,7 +447,10 @@ class Chef
# Ensures runlist override contains RunListItem instances
def runlist_override_sanity_check!
@override_runlist = @override_runlist.split(',') if @override_runlist.is_a?(String)
# Convert to array and remove whitespace
if @override_runlist.is_a?(String)
@override_runlist = @override_runlist.split(',').map { |e| e.strip }
@override_runlist = [@override_runlist].flatten.compact! do |item|
......@@ -239,12 +239,16 @@ shared_examples_for Chef::Client do
@node[:platform] = "example-platform"
@node[:platform_version] = "example-platform-1.0"
@client =, :override_runlist => 'role[test_role]')
@client.node = @node
it "should permit spaces in overriding run list" do
@client =, :override_runlist => 'role[a], role[b]')
it "should override the run list and save original runlist" do
@client =, :override_runlist => 'role[test_role]')
@client.node = @node
@node.run_list << "role[role_containing_cookbook1]"
override_role =
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment