diff options
Diffstat (limited to 'lib/puppet/parser/ast')
-rw-r--r-- | lib/puppet/parser/ast/arithmetic_operator.rb | 6 | ||||
-rw-r--r-- | lib/puppet/parser/ast/boolean_operator.rb | 2 | ||||
-rw-r--r-- | lib/puppet/parser/ast/branch.rb | 2 | ||||
-rw-r--r-- | lib/puppet/parser/ast/collexpr.rb | 7 | ||||
-rw-r--r-- | lib/puppet/parser/ast/comparison_operator.rb | 2 | ||||
-rw-r--r-- | lib/puppet/parser/ast/function.rb | 10 | ||||
-rw-r--r-- | lib/puppet/parser/ast/leaf.rb | 4 | ||||
-rw-r--r-- | lib/puppet/parser/ast/match_operator.rb | 2 | ||||
-rw-r--r-- | lib/puppet/parser/ast/minus.rb | 2 | ||||
-rw-r--r-- | lib/puppet/parser/ast/resource_override.rb | 2 | ||||
-rw-r--r-- | lib/puppet/parser/ast/selector.rb | 2 |
11 files changed, 20 insertions, 21 deletions
diff --git a/lib/puppet/parser/ast/arithmetic_operator.rb b/lib/puppet/parser/ast/arithmetic_operator.rb index 8d9cef86a..b4c0215cc 100644 --- a/lib/puppet/parser/ast/arithmetic_operator.rb +++ b/lib/puppet/parser/ast/arithmetic_operator.rb @@ -18,12 +18,12 @@ class Puppet::Parser::AST lval = @lval.safeevaluate(scope) lval = Puppet::Parser::Scope.number?(lval) if lval == nil - raise ArgumentError, "left operand of %s is not a number" % @operator + raise ArgumentError, "left operand of #{@operator} is not a number" end rval = @rval.safeevaluate(scope) rval = Puppet::Parser::Scope.number?(rval) if rval == nil - raise ArgumentError, "right operand of %s is not a number" % @operator + raise ArgumentError, "right operand of #{@operator} is not a number" end # compute result @@ -34,7 +34,7 @@ class Puppet::Parser::AST super unless %w{+ - * / << >>}.include?(@operator) - raise ArgumentError, "Invalid arithmetic operator %s" % @operator + raise ArgumentError, "Invalid arithmetic operator #{@operator}" end end end diff --git a/lib/puppet/parser/ast/boolean_operator.rb b/lib/puppet/parser/ast/boolean_operator.rb index 89725d73b..9214afbd5 100644 --- a/lib/puppet/parser/ast/boolean_operator.rb +++ b/lib/puppet/parser/ast/boolean_operator.rb @@ -41,7 +41,7 @@ class Puppet::Parser::AST super unless %w{and or}.include?(@operator) - raise ArgumentError, "Invalid boolean operator %s" % @operator + raise ArgumentError, "Invalid boolean operator #{@operator}" end end end diff --git a/lib/puppet/parser/ast/branch.rb b/lib/puppet/parser/ast/branch.rb index 0c481ffe6..c0fa0da30 100644 --- a/lib/puppet/parser/ast/branch.rb +++ b/lib/puppet/parser/ast/branch.rb @@ -31,7 +31,7 @@ class Puppet::Parser::AST @children.each { |child| unless child.is_a?(AST) raise Puppet::DevError, - "child %s is a %s instead of ast" % [child, child.class] + "child #{child} is a #{child.class} instead of ast" end } end diff --git a/lib/puppet/parser/ast/collexpr.rb b/lib/puppet/parser/ast/collexpr.rb index eae2b0e42..95fb5a94f 100644 --- a/lib/puppet/parser/ast/collexpr.rb +++ b/lib/puppet/parser/ast/collexpr.rb @@ -68,11 +68,10 @@ class CollExpr < AST::Branch when "tag" str = "puppet_tags.name #{oper} '#{str2}'" else - str = "param_values.value #{oper} '#{str2}' and " + - "param_names.name = '#{str1}'" + str = "param_values.value #{oper} '#{str2}' and param_names.name = '#{str1}'" end else - str = "(%s) %s (%s)" % [str1, oper, str2] + str = "(#{str1}) #{oper} (#{str2})" end return str, code @@ -82,7 +81,7 @@ class CollExpr < AST::Branch super unless %w{== != and or}.include?(@oper) - raise ArgumentError, "Invalid operator %s" % @oper + raise ArgumentError, "Invalid operator #{@oper}" end end end diff --git a/lib/puppet/parser/ast/comparison_operator.rb b/lib/puppet/parser/ast/comparison_operator.rb index 0d2f8b16d..85903ec31 100644 --- a/lib/puppet/parser/ast/comparison_operator.rb +++ b/lib/puppet/parser/ast/comparison_operator.rb @@ -34,7 +34,7 @@ class Puppet::Parser::AST super unless %w{== != < > <= >=}.include?(@operator) - raise ArgumentError, "Invalid comparison operator %s" % @operator + raise ArgumentError, "Invalid comparison operator #{@operator}" end end end diff --git a/lib/puppet/parser/ast/function.rb b/lib/puppet/parser/ast/function.rb index 98204b14a..c3769cbd4 100644 --- a/lib/puppet/parser/ast/function.rb +++ b/lib/puppet/parser/ast/function.rb @@ -14,28 +14,28 @@ class Puppet::Parser::AST # Make sure it's a defined function unless Puppet::Parser::Functions.function(@name) - raise Puppet::ParseError, "Unknown function %s" % @name + raise Puppet::ParseError, "Unknown function #{@name}" end # Now check that it's been used correctly case @ftype when :rvalue unless Puppet::Parser::Functions.rvalue?(@name) - raise Puppet::ParseError, "Function '%s' does not return a value" % @name + raise Puppet::ParseError, "Function '#{@name}' does not return a value" end when :statement if Puppet::Parser::Functions.rvalue?(@name) raise Puppet::ParseError, - "Function '%s' must be the value of a statement" % @name + "Function '#{@name}' must be the value of a statement" end else - raise Puppet::DevError, "Invalid function type %s" % @ftype.inspect + raise Puppet::DevError, "Invalid function type #{@ftype.inspect}" end # We don't need to evaluate the name, because it's plaintext args = @arguments.safeevaluate(scope) - return scope.send("function_" + @name, args) + return scope.send("function_#{@name}", args) end def initialize(hash) diff --git a/lib/puppet/parser/ast/leaf.rb b/lib/puppet/parser/ast/leaf.rb index 30c4a958f..6ef346123 100644 --- a/lib/puppet/parser/ast/leaf.rb +++ b/lib/puppet/parser/ast/leaf.rb @@ -40,7 +40,7 @@ class Puppet::Parser::AST unless @value == true or @value == false raise Puppet::DevError, - "'%s' is not a boolean" % @value + "'#{@value}' is not a boolean" end @value end @@ -108,7 +108,7 @@ class Puppet::Parser::AST @value = @value.to_s.downcase unless @value.is_a?(Regex) if @value =~ /[^-\w.]/ raise Puppet::DevError, - "'%s' is not a valid hostname" % @value + "'#{@value}' is not a valid hostname" end end diff --git a/lib/puppet/parser/ast/match_operator.rb b/lib/puppet/parser/ast/match_operator.rb index 17e27826e..c528a90e5 100644 --- a/lib/puppet/parser/ast/match_operator.rb +++ b/lib/puppet/parser/ast/match_operator.rb @@ -24,7 +24,7 @@ class Puppet::Parser::AST super unless %w{!~ =~}.include?(@operator) - raise ArgumentError, "Invalid regexp operator %s" % @operator + raise ArgumentError, "Invalid regexp operator #{@operator}" end end end diff --git a/lib/puppet/parser/ast/minus.rb b/lib/puppet/parser/ast/minus.rb index b0779a8ee..52d158e0b 100644 --- a/lib/puppet/parser/ast/minus.rb +++ b/lib/puppet/parser/ast/minus.rb @@ -15,7 +15,7 @@ class Puppet::Parser::AST val = @value.safeevaluate(scope) val = Puppet::Parser::Scope.number?(val) if val == nil - raise ArgumentError, "minus operand %s is not a number" % val + raise ArgumentError, "minus operand #{val} is not a number" end return -val end diff --git a/lib/puppet/parser/ast/resource_override.rb b/lib/puppet/parser/ast/resource_override.rb index f667ed23a..f9071fe96 100644 --- a/lib/puppet/parser/ast/resource_override.rb +++ b/lib/puppet/parser/ast/resource_override.rb @@ -13,7 +13,7 @@ class Puppet::Parser::AST # Iterate across all of our children. def each [@object,@parameters].flatten.each { |param| - #Puppet.debug("yielding param %s" % param) + #Puppet.debug("yielding param #{param}") yield param } end diff --git a/lib/puppet/parser/ast/selector.rb b/lib/puppet/parser/ast/selector.rb index 647bdcde1..8eb930cc4 100644 --- a/lib/puppet/parser/ast/selector.rb +++ b/lib/puppet/parser/ast/selector.rb @@ -34,7 +34,7 @@ class Puppet::Parser::AST # Unless we found something, look for the default. return default.value.safeevaluate(scope) if default - self.fail Puppet::ParseError, "No matching value for selector param '%s'" % paramvalue + self.fail Puppet::ParseError, "No matching value for selector param '#{paramvalue}'" ensure scope.unset_ephemeral_var(level) end |