diff options
author | Luke Kanies <luke@puppetlabs.com> | 2010-04-09 16:02:32 -0700 |
---|---|---|
committer | Luke Kanies <luke@puppetlabs.com> | 2010-04-09 16:02:32 -0700 |
commit | b643413da520fabb7ee81e8c710e30f43bc1475b (patch) | |
tree | 747082b0577b566bbd2bb576d539cb7efebdc2c4 /lib | |
parent | fe140a283fc51216a460be24c19641e26724c92c (diff) | |
download | puppet-b643413da520fabb7ee81e8c710e30f43bc1475b.tar.gz puppet-b643413da520fabb7ee81e8c710e30f43bc1475b.tar.xz puppet-b643413da520fabb7ee81e8c710e30f43bc1475b.zip |
Removing any mentions of :casesensitive setting
It is a setting that was added years ago as a backward
compatibility option and even if it still works, which
is questionable, it has no purpose any longer.
It just complicated the code and didn't do much, so it's gone
now.
Also simplified the interface of Leaf#evaluate_match, since it
was now using none of the passed-in options.
Finally, removed/migrated the last of the Selector/CaseStatement
test/unit tests.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/defaults.rb | 4 | ||||
-rw-r--r-- | lib/puppet/parser/ast/casestatement.rb | 2 | ||||
-rw-r--r-- | lib/puppet/parser/ast/leaf.rb | 10 | ||||
-rw-r--r-- | lib/puppet/parser/ast/selector.rb | 4 |
4 files changed, 7 insertions, 13 deletions
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb index fa1b31c73..2f397f495 100644 --- a/lib/puppet/defaults.rb +++ b/lib/puppet/defaults.rb @@ -707,10 +707,6 @@ module Puppet ) setdefaults(:main, - :casesensitive => [false, - "Whether matching in case statements and selectors - should be case-sensitive. Case insensitivity is - handled by downcasing all values before comparison."], :external_nodes => ["none", "An external command that can produce node information. The output must be a YAML dump of a hash, and that hash must have one or both of diff --git a/lib/puppet/parser/ast/casestatement.rb b/lib/puppet/parser/ast/casestatement.rb index 64298cac3..720ef240b 100644 --- a/lib/puppet/parser/ast/casestatement.rb +++ b/lib/puppet/parser/ast/casestatement.rb @@ -20,7 +20,7 @@ class Puppet::Parser::AST default = nil @options.each do |option| option.eachopt do |opt| - return option.safeevaluate(scope) if opt.evaluate_match(value, scope, :file => file, :line => line, :sensitive => Puppet[:casesensitive]) + return option.safeevaluate(scope) if opt.evaluate_match(value, scope) end default = option if option.default? diff --git a/lib/puppet/parser/ast/leaf.rb b/lib/puppet/parser/ast/leaf.rb index caf1d13a5..30c4a958f 100644 --- a/lib/puppet/parser/ast/leaf.rb +++ b/lib/puppet/parser/ast/leaf.rb @@ -11,12 +11,12 @@ class Puppet::Parser::AST end # evaluate ourselves, and match - def evaluate_match(value, scope, options = {}) + def evaluate_match(value, scope) obj = self.safeevaluate(scope) - if options[:sensitive] - obj = obj.downcase if obj.respond_to?(:downcase) - value = value.downcase if value.respond_to?(:downcase) - end + + obj = obj.downcase if obj.respond_to?(:downcase) + value = value.downcase if value.respond_to?(:downcase) + # "" == undef for case/selector/if obj == value or (obj == "" and value == :undef) end diff --git a/lib/puppet/parser/ast/selector.rb b/lib/puppet/parser/ast/selector.rb index ce834b63b..d27773c4b 100644 --- a/lib/puppet/parser/ast/selector.rb +++ b/lib/puppet/parser/ast/selector.rb @@ -15,8 +15,6 @@ class Puppet::Parser::AST # Get our parameter. paramvalue = @param.safeevaluate(scope) - sensitive = Puppet[:casesensitive] - default = nil unless @values.instance_of? AST::ASTArray or @values.instance_of? Array @@ -26,7 +24,7 @@ class Puppet::Parser::AST # Then look for a match in the options. @values.each do |obj| # short circuit asap if we have a match - return obj.value.safeevaluate(scope) if obj.param.evaluate_match(paramvalue, scope, :file => file, :line => line, :sensitive => sensitive) + return obj.value.safeevaluate(scope) if obj.param.evaluate_match(paramvalue, scope) # Store the default, in case it's necessary. default = obj if obj.param.is_a?(Default) |