Issue #8974 has been updated by Brett Bender.

To silence the warning, one needs to use:

  class_variable_set(:@@foo, value)

rather than:

  @@foo = value

The following works for me:

% gem list puppet
*** LOCAL GEMS ***
puppet (2.7.3)

% ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]

diff -r orig/bsd.rb patched/bsd.rb
11c11
<   @@rcconf_dir = '/etc/rc.conf.d'
---
>   class_variable_set(:@@rcconf_dir, '/etc/rc.conf.d')
diff -r orig/freebsd.rb patched/freebsd.rb
8,10c8,10
<   @@rcconf = '/etc/rc.conf'
<   @@rcconf_local = '/etc/rc.conf.local'
<   @@rcconf_dir = '/etc/rc.conf.d'
---
>   class_variable_set(:@@rcconf,       '/etc/rc.conf')
>   class_variable_set(:@@rcconf_local, '/etc/rc.conf.local')
>   class_variable_set(:@@rcconf_dir,   '/etc/rc.conf.d')

----------------------------------------
Bug #8974: class variable access from toplevel warnings in bsd service
https://projects.puppetlabs.com/issues/8974

Author: Max Lincoln
Status: Needs More Information
Priority: Normal
Assignee: 
Category: ruby19
Target version: 
Affected Puppet version: 2.7.1
Keywords: 
Branch: 


Running puppet 2.7.1 on:
 
 * Rackspace
 * RHEL 5.6

I get these warnings:
<pre>
/usr/local/lib/ruby/gems/1.9.1/gems/puppet-2.7.1/lib/puppet/provider/service/freebsd.rb:8:
 warning: class variable access from toplevel
/usr/local/lib/ruby/gems/1.9.1/gems/puppet-2.7.1/lib/puppet/provider/service/freebsd.rb:9:
 warning: class variable access from toplevel
/usr/local/lib/ruby/gems/1.9.1/gems/puppet-2.7.1/lib/puppet/provider/service/freebsd.rb:10:
 warning: class variable access from toplevel
/usr/local/lib/ruby/gems/1.9.1/gems/puppet-2.7.1/lib/puppet/provider/service/bsd.rb:11:
 warning: class variable access from toplevel
</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