Problems with chef 12.0.3-1 and lvm cookbook

I was testing one of our cookbooks using kitchen/vagrant and received the following error message:

  ←[0m
  ================================================================================
  Error executing action `create` on resource 'lvm_logical_volume[lv_jenkins]'
  ================================================================================

←[0m NoMethodError
-------------
undefined method `directory’ for #Chef::Provider::LvmLogicalVolume:0x0000000430dd48

  Cookbook Trace:
         ---------------

   /tmp/kitchen/cookbooks/lvm/libraries/provider_lvm_logical_volume.rb:107:in `action_create'
         /tmp/kitchen/cookbooks/lvm/libraries/provider_lvm_volume_group.rb:98:in `block in create_logical_volumes'
         /tmp/kitchen/cookbooks/lvm/libraries/provider_lvm_volume_group.rb:96:in `each'
         /tmp/kitchen/cookbooks/lvm/libraries/provider_lvm_volume_group.rb:96:in `create_logical_volumes'
         /tmp/kitchen/cookbooks/lvm/libraries/provider_lvm_volume_group.rb:58:in `action_create'

         Resource Declaration:
         ---------------------
         # In /tmp/kitchen/cookbooks/lvm/libraries/resource_lvm_volume_group.rb

         109:         volume = lvm_logical_volume(name, &block)
         110:         volume.action :nothing



   Compiled Resource:
         ------------------

         # Declared in /tmp/kitchen/cookbooks/lvm/libraries/resource_lvm_volume_group.rb:109:in `logical_volume'

         lvm_logical_volume("lv_jenkins") do
           provider Chef::Provider::LvmLogicalVolume
           action [:nothing]
           retries 0

This is using version 1.2.2 of the opscode lvm cookbook. Everything works fine when I force kitchen to use chef 11.8.0. I was assuming that chef 12.x would be backwards compatible. Is this not the case?

Thanks,

John Warren

Seems a lot like this issue:

which is also really well explained over on the ark cookbook’s issues tracker:

We solved an issue like this on the Zookeeper cookbook by renaming the module Ridiculous, I know, but it worked.


Jeff Byrnes
@thejeffbyrnes
Lead DevOps Engineer
EverTrue
704.516.4628

On January 21, 2015 at 3:47:02 PM, John Warren (j0hnwarr3n@gmail.com) wrote:

I was testing one of our cookbooks using kitchen/vagrant and received the following error message:

  ←[0m
  ================================================================================
  Error executing action `create` on resource 'lvm_logical_volume[lv_jenkins]'
  ================================================================================

←[0m NoMethodError
-------------
undefined method `directory’ for #Chef::Provider::LvmLogicalVolume:0x0000000430dd48

  Cookbook Trace:
         ---------------

   /tmp/kitchen/cookbooks/lvm/libraries/provider_lvm_logical_volume.rb:107:in `action_create'
         /tmp/kitchen/cookbooks/lvm/libraries/provider_lvm_volume_group.rb:98:in `block in create_logical_volumes'
         /tmp/kitchen/cookbooks/lvm/libraries/provider_lvm_volume_group.rb:96:in `each'
         /tmp/kitchen/cookbooks/lvm/libraries/provider_lvm_volume_group.rb:96:in `create_logical_volumes'
         /tmp/kitchen/cookbooks/lvm/libraries/provider_lvm_volume_group.rb:58:in `action_create'

         Resource Declaration:
         ---------------------
         # In /tmp/kitchen/cookbooks/lvm/libraries/resource_lvm_volume_group.rb

         109:         volume = lvm_logical_volume(name, &block)
         110:         volume.action :nothing



   Compiled Resource:
         ------------------

         # Declared in /tmp/kitchen/cookbooks/lvm/libraries/resource_lvm_volume_group.rb:109:in `logical_volume'

         lvm_logical_volume("lv_jenkins") do
           provider Chef::Provider::LvmLogicalVolume
           action [:nothing]
           retries 0

This is using version 1.2.2 of the opscode lvm cookbook. Everything works fine when I force kitchen to use chef 11.8.0. I was assuming that chef 12.x would be backwards compatible. Is this not the case?

Thanks,

John Warren

The cookbook needs to be updated for Chef 12. Add "include Chef::DSL::Recipe" to the top of the providers.

--Noah

On Jan 21, 2015, at 12:42 PM, John Warren j0hnwarr3n@gmail.com wrote:

I was testing one of our cookbooks using kitchen/vagrant and received the following error message:

  ←[0m
  ================================================================================
  Error executing action `create` on resource 'lvm_logical_volume[lv_jenkins]'
  ================================================================================

←[0m NoMethodError
-------------
undefined method `directory' for #Chef::Provider::LvmLogicalVolume:0x0000000430dd48

  Cookbook Trace:
         ---------------

   /tmp/kitchen/cookbooks/lvm/libraries/provider_lvm_logical_volume.rb:107:in `action_create'
         /tmp/kitchen/cookbooks/lvm/libraries/provider_lvm_volume_group.rb:98:in `block in create_logical_volumes'
         /tmp/kitchen/cookbooks/lvm/libraries/provider_lvm_volume_group.rb:96:in `each'
         /tmp/kitchen/cookbooks/lvm/libraries/provider_lvm_volume_group.rb:96:in `create_logical_volumes'
         /tmp/kitchen/cookbooks/lvm/libraries/provider_lvm_volume_group.rb:58:in `action_create'

         Resource Declaration:
         ---------------------
         # In /tmp/kitchen/cookbooks/lvm/libraries/resource_lvm_volume_group.rb

         109:         volume = lvm_logical_volume(name, &block)
         110:         volume.action :nothing



   Compiled Resource:
         ------------------

         # Declared in /tmp/kitchen/cookbooks/lvm/libraries/resource_lvm_volume_group.rb:109:in `logical_volume'

         lvm_logical_volume("lv_jenkins") do
           provider Chef::Provider::LvmLogicalVolume
           action [:nothing]
           retries 0

This is using version 1.2.2 of the opscode lvm cookbook. Everything works fine when I force kitchen to use chef 11.8.0. I was assuming that chef 12.x would be backwards compatible. Is this not the case?

Thanks,

John Warren

Nope. 12 is a major release, intended to have some brekage.
This is a known issue, we have submitted a PR [1], which should fix this.
[1]Include Chef::DSL::Recipe in HWRPs which require it (and fix Chef12) by evan2645 · Pull Request #46 · sous-chefs/lvm · GitHub

On Wed, Jan 21, 2015 at 12:42 PM, John Warren j0hnwarr3n@gmail.com wrote:

I was testing one of our cookbooks using kitchen/vagrant and received
the following error message:

  ←[0m

================================================================================
Error executing action create on resource
'lvm_logical_volume[lv_jenkins]'

================================================================================

←[0m NoMethodError
-------------
undefined method `directory' for
#Chef::Provider::LvmLogicalVolume:0x0000000430dd48

  Cookbook Trace:
         ---------------

/tmp/kitchen/cookbooks/lvm/libraries/provider_lvm_logical_volume.rb:107:in
`action_create'

/tmp/kitchen/cookbooks/lvm/libraries/provider_lvm_volume_group.rb:98:in
`block in create_logical_volumes'

/tmp/kitchen/cookbooks/lvm/libraries/provider_lvm_volume_group.rb:96:in
`each'

/tmp/kitchen/cookbooks/lvm/libraries/provider_lvm_volume_group.rb:96:in
`create_logical_volumes'

/tmp/kitchen/cookbooks/lvm/libraries/provider_lvm_volume_group.rb:58:in
`action_create'

         Resource Declaration:
         ---------------------
         # In

/tmp/kitchen/cookbooks/lvm/libraries/resource_lvm_volume_group.rb

         109:         volume = lvm_logical_volume(name, &block)
         110:         volume.action :nothing



   Compiled Resource:
         ------------------

         # Declared in

/tmp/kitchen/cookbooks/lvm/libraries/resource_lvm_volume_group.rb:109:in
`logical_volume'

         lvm_logical_volume("lv_jenkins") do
           provider Chef::Provider::LvmLogicalVolume
           action [:nothing]
           retries 0

This is using version 1.2.2 of the opscode lvm cookbook. Everything works
fine when I force kitchen to use chef 11.8.0. I was assuming that chef
12.x would be backwards compatible. Is this not the case?

Thanks,

John Warren