diff options
author | Jesse Wolfe <jes5199@gmail.com> | 2009-11-11 23:22:03 -0800 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-11-13 14:36:15 +1100 |
commit | 65f601a99a0ca7ebacfda7a6becd8af9fe9eaacb (patch) | |
tree | 8fce2cd425fc2c50cf69b28db45a6663eab8fd4c /lib/puppet | |
parent | e2c675edb5aecb5af6399ac53f9a85ed8214b8e9 (diff) | |
download | puppet-65f601a99a0ca7ebacfda7a6becd8af9fe9eaacb.tar.gz puppet-65f601a99a0ca7ebacfda7a6becd8af9fe9eaacb.tar.xz puppet-65f601a99a0ca7ebacfda7a6becd8af9fe9eaacb.zip |
Fixing 2806 Specifying multiple tags fails to apply any of them
Fix code that was passing an Array of code to a method that was
expecting a single tag.
Includes Markus's suggestions
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/transaction.rb | 7 | ||||
-rw-r--r-- | lib/puppet/util/tagging.rb | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/lib/puppet/transaction.rb b/lib/puppet/transaction.rb index 8ea8ccd1b..a0d5b16a9 100644 --- a/lib/puppet/transaction.rb +++ b/lib/puppet/transaction.rb @@ -620,8 +620,11 @@ class Transaction # Is this resource tagged appropriately? def missing_tags?(resource) - return false if self.ignore_tags? or tags.empty? - return true unless resource.tagged?(tags) + not appropriately_tagged?(resource) + end + + def appropriately_tagged?(resource) + self.ignore_tags? or tags.empty? or resource.tagged?(*tags) end # Are there any edges that target this resource? diff --git a/lib/puppet/util/tagging.rb b/lib/puppet/util/tagging.rb index f421d18d8..03a8b8a9a 100644 --- a/lib/puppet/util/tagging.rb +++ b/lib/puppet/util/tagging.rb @@ -21,8 +21,8 @@ module Puppet::Util::Tagging end # Are we tagged with the provided tag? - def tagged?(tag) - defined?(@tags) and @tags.include?(tag.to_s) + def tagged?(*tags) + not ( self.tags & tags.flatten.collect { |t| t.to_s } ).empty? end # Return a copy of the tag list, so someone can't ask for our tags |