Issue #5184 has been updated by Nigel Kersten.

Status changed from Unreviewed to Accepted


----------------------------------------
Bug #5184: new referecne syntax cannot be overridden to undef using class 
inheritence
https://projects.puppetlabs.com/issues/5184

Author: Dan Bode
Status: Accepted
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


The new reference syntax does not seem to work with class inheritence:

<pre>
class bluetooth {
  package { 'bluez-libs':
   ensure => present,
  }->
  package { 'bluez-utils':
   ensure => present,
  }
}
class bluetooth::disable inherits  bluetooth {
  Package['bluez-libs']{before => undef}
}
include bluetooth::disable
</pre>

returns the following:
<pre>
# puppet relat_bug.pp -d --trace
info: Loading facts in gem_count
info: Loading facts in packages
info: Loading facts in has_yum
info: Loading facts in yum_version
debug: Puppet::Type::Package::ProviderRpm: Executing '/bin/rpm --version'
debug: Puppet::Type::Package::ProviderUrpmi: Executing '/bin/rpm -ql rpm'
debug: Puppet::Type::Package::ProviderAptrpm: Executing '/bin/rpm -ql rpm'
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm --version'
debug: Adding relationship from Package[bluez-libs] to Package[bluez-utils] 
with 'before'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/relationship.rb:41:in 
`mk_relationship'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/relationship.rb:19:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/relationship.rb:18:in `each'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/relationship.rb:18:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/relationship.rb:17:in `each'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/relationship.rb:17:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:162:in 
`evaluate_relationships'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:162:in `each'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:162:in 
`evaluate_relationships'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:341:in `finish'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:109: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:115: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:300:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:397:in `exit_on_fail'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:300: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:115: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:300:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:397:in `exit_on_fail'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:300:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:55:in `execute'
/usr/bin/puppet:4
undefined method `<<' for :undef:Symbol on node localhost.localdomain
</pre>

The equivalent using the before metaparameter works
<pre>
class bluetooth {
  package { 'bluez-libs':
    ensure => present,
    before => Package['bluez-utils']
  }
  package { 'bluez-utils':
    ensure => present,
  }
}
class bluetooth::disable inherits  bluetooth {
  Package['bluez-libs']{before => undef}
}
include bluetooth::disable
</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to