summaryrefslogtreecommitdiff
path: root/lib/chef/resource/lwrp_base.rb
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2015-06-16 11:40:03 -0700
committerJohn Keiser <john@johnkeiser.com>2015-06-16 11:40:03 -0700
commitd3b3ff2be6c96c9412a8df5dca29cc121f069815 (patch)
treeebb59686d6b4ddda207b28d901096d5529ceabef /lib/chef/resource/lwrp_base.rb
parentbc5227d5ac004800a30b7b1353fa7461b132f2cb (diff)
downloadchef-d3b3ff2be6c96c9412a8df5dca29cc121f069815.tar.gz
Support arrays as input to actions / allowed_actionsjk/3535
Diffstat (limited to 'lib/chef/resource/lwrp_base.rb')
-rw-r--r--lib/chef/resource/lwrp_base.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/resource/lwrp_base.rb b/lib/chef/resource/lwrp_base.rb
index 86e22dd92b..ef3c2b5bba 100644
--- a/lib/chef/resource/lwrp_base.rb
+++ b/lib/chef/resource/lwrp_base.rb
@@ -85,8 +85,9 @@ class Chef
# Adds +action_names+ to the list of valid actions for this resource.
# Does not include superclass's action list when appending.
def actions(*action_names)
+ action_names = action_names.flatten
if !action_names.empty? && !@allowed_actions
- self.allowed_actions = [ :nothing ] + action_names
+ self.allowed_actions = ([ :nothing ] + action_names).uniq
else
allowed_actions(*action_names)
end