Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mirror
chef
Commits
2c42e1d6
Commit
2c42e1d6
authored
Sep 30, 2012
by
Zachary Stevens
Committed by
Bryan McLellan
Oct 04, 2012
Browse files
[CHEF-3489] Permit whitespace in chef-client's -o argument.
parent
07d15b16
Changes
2
Hide whitespace changes
Inline
Side-by-side
chef/lib/chef/client.rb
View file @
2c42e1d6
...
@@ -447,7 +447,10 @@ class Chef
...
@@ -447,7 +447,10 @@ class Chef
# Ensures runlist override contains RunListItem instances
# Ensures runlist override contains RunListItem instances
def
runlist_override_sanity_check!
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
}
end
@override_runlist
=
[
@override_runlist
].
flatten
.
compact
@override_runlist
=
[
@override_runlist
].
flatten
.
compact
@override_runlist
.
map!
do
|
item
|
@override_runlist
.
map!
do
|
item
|
if
(
item
.
is_a?
(
Chef
::
RunList
::
RunListItem
))
if
(
item
.
is_a?
(
Chef
::
RunList
::
RunListItem
))
...
...
chef/spec/unit/client_spec.rb
View file @
2c42e1d6
...
@@ -239,12 +239,16 @@ shared_examples_for Chef::Client do
...
@@ -239,12 +239,16 @@ shared_examples_for Chef::Client do
@node
.
chef_environment
(
"_default"
)
@node
.
chef_environment
(
"_default"
)
@node
[
:platform
]
=
"example-platform"
@node
[
:platform
]
=
"example-platform"
@node
[
:platform_version
]
=
"example-platform-1.0"
@node
[
:platform_version
]
=
"example-platform-1.0"
end
@client
=
Chef
::
Client
.
new
(
nil
,
:
overrid
e_
runlist
=>
'role[test_role]'
)
it
"should permit spaces in
overrid
ing
run
list
"
do
@client
.
node
=
@node
@client
=
Chef
::
Client
.
new
(
nil
,
:override_runlist
=>
'role[a], role[b]'
)
end
end
it
"should override the run list and save original runlist"
do
it
"should override the run list and save original runlist"
do
@client
=
Chef
::
Client
.
new
(
nil
,
:override_runlist
=>
'role[test_role]'
)
@client
.
node
=
@node
@node
.
run_list
<<
"role[role_containing_cookbook1]"
@node
.
run_list
<<
"role[role_containing_cookbook1]"
override_role
=
Chef
::
Role
.
new
override_role
=
Chef
::
Role
.
new
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment