summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2008-02-24 09:32:44 +1100
committerJames Turnbull <james@lovedthanlost.net>2008-02-24 09:32:44 +1100
commitf184228956fc4c2050a5901130fd506b8f069dd6 (patch)
treea5f0e7008f22b292fe524604c38ae01b1985e08e
parent5d35bc5904a09bc07a11039500c59021bafaee7e (diff)
downloadpuppet-f184228956fc4c2050a5901130fd506b8f069dd6.tar.gz
puppet-f184228956fc4c2050a5901130fd506b8f069dd6.tar.xz
puppet-f184228956fc4c2050a5901130fd506b8f069dd6.zip
Fixes ticket #1079 - added . support for tags
-rw-r--r--lib/puppet/util/tagging.rb2
-rwxr-xr-xspec/unit/util/tagging.rb4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/puppet/util/tagging.rb b/lib/puppet/util/tagging.rb
index 9abb3fb2b..8a50f3458 100644
--- a/lib/puppet/util/tagging.rb
+++ b/lib/puppet/util/tagging.rb
@@ -34,6 +34,6 @@ module Puppet::Util::Tagging
private
def valid_tag?(tag)
- tag =~ /^\w[-\w:]*$/
+ tag =~ /^\w[-\w:.]*$/
end
end
diff --git a/spec/unit/util/tagging.rb b/spec/unit/util/tagging.rb
index 91cbb213d..d61ee8ccb 100755
--- a/spec/unit/util/tagging.rb
+++ b/spec/unit/util/tagging.rb
@@ -61,6 +61,10 @@ describe Puppet::Util::Tagging, "when adding tags" do
lambda { @tagger.tag("good_tag") }.should_not raise_error(Puppet::ParseError)
end
+ it "should allow tags containing '.' characters" do
+ lambda { @tagger.tag("good.tag") }.should_not raise_error(Puppet::ParseError)
+ end
+
it "should provide a method for testing tag validity" do
@tagger.metaclass.publicize_methods(:valid_tag?) { @tagger.should be_respond_to(:valid_tag?) }
end