summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/ast/leaf.rb
diff options
context:
space:
mode:
authorlutter <lutter@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-04 19:57:54 +0000
committerlutter <lutter@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-04 19:57:54 +0000
commitc0a9e5f2e9df8e6e1aed74653ae675029af8a9bb (patch)
tree8c4008e3cf2a8b10332534edaecf42feeba49cf3 /lib/puppet/parser/ast/leaf.rb
parent5d42cd51a3502518a5d0a22928a133768dcaeb1a (diff)
downloadpuppet-c0a9e5f2e9df8e6e1aed74653ae675029af8a9bb.tar.gz
puppet-c0a9e5f2e9df8e6e1aed74653ae675029af8a9bb.tar.xz
puppet-c0a9e5f2e9df8e6e1aed74653ae675029af8a9bb.zip
Change how names for nodes are specified: the 'node' keyword can be followed by a NAME or by single quoted text, i.e. fully qualified names for nodes must be enclosed in single quotes
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1064 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parser/ast/leaf.rb')
-rw-r--r--lib/puppet/parser/ast/leaf.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/puppet/parser/ast/leaf.rb b/lib/puppet/parser/ast/leaf.rb
index eeeee45fd..609bcd3cc 100644
--- a/lib/puppet/parser/ast/leaf.rb
+++ b/lib/puppet/parser/ast/leaf.rb
@@ -70,7 +70,16 @@ class Puppet::Parser::AST
class Name < AST::Leaf; end
# Host names, either fully qualified or just the short name
- class HostName < AST::Leaf; end
+ class HostName < AST::Leaf
+ def initialize(hash)
+ super
+
+ unless @value =~ %r{^[0-9a-zA-Z\-]+(\.[0-9a-zA-Z\-]+)*$}
+ raise Puppet::DevError,
+ "'%s' is not a valid hostname" % @value
+ end
+ end
+ end
# A simple variable. This object is only used during interpolation;
# the VarDef class is used for assignment.