summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrice Figureau <brice-puppet@daysofwonder.com>2009-06-03 20:09:56 +0200
committerJames Turnbull <james@lovedthanlost.net>2009-06-06 09:52:53 +1000
commitb5855ec1a5af2bec6c4ac35f8e6a885999b09bf9 (patch)
treeb185d49e6fdcee2da5131384f9022c35dfb7ff54
parentd69fffb63ca9efe3cca67167430b23d3b8d38fa4 (diff)
downloadpuppet-b5855ec1a5af2bec6c4ac35f8e6a885999b09bf9.tar.gz
puppet-b5855ec1a5af2bec6c4ac35f8e6a885999b09bf9.tar.xz
puppet-b5855ec1a5af2bec6c4ac35f8e6a885999b09bf9.zip
Make sure resources are tagged with the user tag on the server
It appears that resources were not tagged with user tag on the server, which prevents those tags to be persisted as tag in the storeconfigs. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
-rw-r--r--lib/puppet/parser/resource.rb1
-rwxr-xr-xspec/unit/parser/resource.rb7
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb
index 32ea4573c..e7932de84 100644
--- a/lib/puppet/parser/resource.rb
+++ b/lib/puppet/parser/resource.rb
@@ -139,6 +139,7 @@ class Puppet::Parser::Resource
if params = options[:params]
options.delete(:params)
params.each do |param|
+ tag(*param.value) if param.name == :tag
set_parameter(param)
end
end
diff --git a/spec/unit/parser/resource.rb b/spec/unit/parser/resource.rb
index e879fb315..bdaa05bf6 100755
--- a/spec/unit/parser/resource.rb
+++ b/spec/unit/parser/resource.rb
@@ -92,6 +92,13 @@ describe Puppet::Parser::Resource do
res = Puppet::Parser::Resource.new(@arguments)
res.ref.should == "Resource[testing]"
end
+
+ it "should be tagged with user tags" do
+ tags = [ "tag1", "tag2" ]
+ @arguments[:params] = [ param(:tag, tags , :source) ]
+ res = Puppet::Parser::Resource.new(@arguments)
+ (res.tags & tags).should == tags
+ end
end
describe "when evaluating" do