Bug #4287

undefined method 'evaluate_match' when function call used in an "if" statement

Added by Alan Harder almost 2 years ago. Updated about 1 month ago.

Status:Closed Start date:07/19/2010
Priority:High Due date:
Assignee:- % Done:

0%

Category:parser
Target version:2.6.0
Affected Puppet version:2.6.0rc4 Branch:http://github.com/mmrobins/puppet/tree/ticket/master/4287-function_evaulate_match
Keywords:parser comparison
Votes: 1

Description

node mytest {
  $foo = 'abc'
  if $foo != regsubst($foo,'abc','def') {
    notify { 'foo': }
  }
}

The above test case on 2.6.0rc4 gets this:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: undefined method `evaluate_match' for # at /etc/puppet/manifests/nodes.pp:33 on node {...}

History

Updated by James Turnbull almost 2 years ago

Full stack trace:


/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/comparison_operator.rb:22:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast.rb:72:in `safeevaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/ifstatement.rb:20:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast.rb:72:in `safeevaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/astarray.rb:35:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/astarray.rb:34:in `collect'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/astarray.rb:34:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast.rb:72:in `safeevaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/resource/type.rb:75:in `evaluate_code'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/resource.rb:69:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:224:in `evaluate_ast_node'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:102:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:18:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:77:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:180:in `benchmark'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:75:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:34:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/indirection.rb:193:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector.rb:50:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:112:in `main'
/usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:35:in `run_command'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:301:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:398:in `exit_on_fail'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:301:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:55:in `execute'
/usr/bin/puppet:4
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:21:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:77:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:180:in `benchmark'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:75:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:34:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/indirection.rb:193:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector.rb:50:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:112:in `main'
/usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:35:in `run_command'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:301:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:398:in `exit_on_fail'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:301:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:55:in `execute'
/usr/bin/puppet:4
undefined method `evaluate_match' for # at /tmp/if.pp:3 on node pelin.members.linode.com

Updated by James Turnbull almost 2 years ago

  • Status changed from Unreviewed to Investigating
  • Target version set to 2.6.0

Updated by Matt Robinson almost 2 years ago

  • Status changed from Investigating to In Topic Branch Pending Review
  • Assignee set to Matt Robinson
  • Keywords set to parser comparison
  • Branch set to http://github.com/mmrobins/puppet/tree/ticket/master/4287-function_evaulate_match

Updated by Alan Harder almost 2 years ago

This patch worked for me, thanks.

Updated by James Turnbull almost 2 years ago

  • Status changed from In Topic Branch Pending Review to Closed

Pushed in commit:539d71635132bd5f772a550b7bfff530e8b59b68 in branch master.

Updated by Daniel Pittman about 1 month ago

  • Assignee deleted (Matt Robinson)

Also available in: Atom PDF