[chef] Re: Re: dhcp cookbook error: FATAL: NameError: uninitialized constant Chef::DSL


Chronological Thread 
  • From: Jesse Nelson < >
  • To: chef < >
  • Subject: [chef] Re: Re: dhcp cookbook error: FATAL: NameError: uninitialized constant Chef::DSL
  • Date: Thu, 6 Jun 2013 11:58:36 -0700

Yep missed the version there..  I've already fixed in develop branch on github, but I think I am going to make the cook chef11 only as I want to move to use_inline_resources. Anyhow I'll be trying to get specs and some kitchen on this cook up to speed with whats modern and cut another community release.

- Jesse



On Thu, Jun 6, 2013 at 8:20 AM, Daniel DeLeo < " target="_blank"> > wrote:

On Thursday, June 6, 2013 at 6:48 AM, Vladimir Skubriev wrote:

I installed depends for this cookbook http://community.opscode.com/cookbooks/dhcp

And succefully upload it to the server

When I run chef-client on client. I got an error:

Recipe Compile Error in /var/chef/cache/cookbooks/dhcp/libraries/failover.rb
================================================================================

NameError
---------
uninitialized constant Chef::DSL

Cookbook Trace:
---------------
  /var/chef/cache/cookbooks/dhcp/libraries/failover.rb:8:in `singletonclass'
  /var/chef/cache/cookbooks/dhcp/libraries/failover.rb:4:in `<module:Failover>'
  /var/chef/cache/cookbooks/dhcp/libraries/failover.rb:3:in `<module:DHCP>'
  /var/chef/cache/cookbooks/dhcp/libraries/failover.rb:2:in `<top (required)>'

Relevant File Content:
----------------------
/var/chef/cache/cookbooks/dhcp/libraries/failover.rb:

  1: 
  2:  module DHCP
  3:    module Failover
  4:      class << self
  5:        if  Chef::Version.new(Chef::VERSION) <= Chef::Version.new( "10.16.2" )
  6:          include Chef::Mixin::Language
  7:        else
  8>>         include Chef::DSL::DataQuery
  9:        end

Looks like a cookbook bug. The author is trying to guard for some changes we made in Chef 11, so the version check should be:

   Chef::Version.new(Chef::VERSION) <= Chef::Version.new( "11.0.0" )

You can get in touch with the author here: https://github.com/spheromak/dhcp-cook to file a bug report or submit a patch.

-- 
Daniel DeLeo





Archive powered by MHonArc 2.6.16.

§