diff options
author | Jos Backus <jos@catnook.com> | 2015-10-16 14:52:06 -0700 |
---|---|---|
committer | Jos Backus <jos@catnook.com> | 2015-10-16 16:34:10 -0700 |
commit | a6c3b5c1466ebcfcf1ba4a1a2686e59739554f68 (patch) | |
tree | b378e80cc372f4491c1fdba545ad9f215b5317dd | |
parent | 6200bf0d319a236f2ab93e83166919c392a22abf (diff) | |
download | chef-a6c3b5c1466ebcfcf1ba4a1a2686e59739554f68.tar.gz |
Use the initializer to avoid NoMethodError on nil.include?
Rename the argument so as to not collide with the tags method.
-rw-r--r-- | lib/chef/node.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/node.rb b/lib/chef/node.rb index 1e4a850277..e04ac23c54 100644 --- a/lib/chef/node.rb +++ b/lib/chef/node.rb @@ -376,12 +376,12 @@ class Chef normal[:tags] end - def tag(*tags) - tags.each do |tag| - self.normal[:tags].push(tag.to_s) unless self[:tags].include? tag.to_s + def tag(*args) + args.each do |tag| + tags.push(tag.to_s) unless tags.include? tag.to_s end - self[:tags] + tags end # Extracts the run list from +attrs+ and applies it. Returns the remaining attributes |