diff options
| -rw-r--r-- | lib/puppet/transaction.rb | 7 | ||||
| -rwxr-xr-x | spec/unit/other/transaction.rb | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/puppet/transaction.rb b/lib/puppet/transaction.rb index 976bf7c68..14b2037f4 100644 --- a/lib/puppet/transaction.rb +++ b/lib/puppet/transaction.rb @@ -15,8 +15,6 @@ class Transaction # The list of events generated in this transaction. attr_reader :events - attr_writer :tags - include Puppet::Util # Add some additional times for reporting @@ -636,6 +634,11 @@ class Transaction @tags end + + def tags=(tags) + tags = [tags] unless tags.is_a?(Array) + @tags = tags + end # Is this resource tagged appropriately? def missing_tags?(resource) diff --git a/spec/unit/other/transaction.rb b/spec/unit/other/transaction.rb index e277a24c0..0db470d26 100755 --- a/spec/unit/other/transaction.rb +++ b/spec/unit/other/transaction.rb @@ -25,4 +25,9 @@ describe Puppet::Transaction, " when determining tags" do @transaction.tags = %w{one two} @transaction.tags.should == %w{one two} end + + it "should always convert assigned tags to an array" do + @transaction.tags = "one::two" + @transaction.tags.should == %w{one::two} + end end |
