summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-05-17 21:51:36 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-05-17 21:51:36 +0000
commite8d560ea8242d99f5be51f9385c5045f46ee7015 (patch)
tree5f1df5c7f41cfcd695ee7ddcde36a6ea81f1294f
parenteed85f41ffc31649032114b7aa89a541d239a257 (diff)
downloadpuppet-e8d560ea8242d99f5be51f9385c5045f46ee7015.tar.gz
puppet-e8d560ea8242d99f5be51f9385c5045f46ee7015.tar.xz
puppet-e8d560ea8242d99f5be51f9385c5045f46ee7015.zip
Fixing #566 -- definitions, tags, and classes can now be single characters
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2523 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r--CHANGELOG3
-rw-r--r--lib/puppet/parser/scope.rb2
-rwxr-xr-xtest/language/scope.rb2
3 files changed, 5 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index c8c9db2f2..cb2c3fcc2 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+ Tags (and thus definitions and classes) can now be a single
+ character. (#566)
+
Added an 'undef' keyword (#629), which will evaluate to ""
within strings but when used as a resource parameter value
will cause that parameter to be evaluated as undefined.
diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb
index c7b36e36c..2f4917bee 100644
--- a/lib/puppet/parser/scope.rb
+++ b/lib/puppet/parser/scope.rb
@@ -629,7 +629,7 @@ class Puppet::Parser::Scope
Puppet.debug "got told to tag with %s" % tag.inspect
next
end
- unless tag =~ /^\w[-\w]+$/
+ unless tag =~ /^\w[-\w]*$/
fail Puppet::ParseError, "Invalid tag %s" % tag.inspect
end
tag = tag.to_s
diff --git a/test/language/scope.rb b/test/language/scope.rb
index 0c9881dac..7fb14786e 100755
--- a/test/language/scope.rb
+++ b/test/language/scope.rb
@@ -613,7 +613,7 @@ Host <<||>>"
end
# Now make sure good tags make it through.
- tags = %w{good-tag yaytag GoodTag another_tag}
+ tags = %w{good-tag yaytag GoodTag another_tag a ab A}
tags.each do |tag|
assert_nothing_raised("Tag #{tag} was considered invalid") do
scope.tag tag