rabbitmq / chef-cookbook

Development repository for Chef cookbook RabbitMQ
https://supermarket.chef.io/cookbooks/rabbitmq
Apache License 2.0
214 stars 423 forks source link

Chef >=14 compatibility only? #594

Open fr33l opened 2 years ago

fr33l commented 2 years ago

Looks like rework in https://github.com/rabbitmq/chef-cookbook/commit/f046999255a84d51f909ddb47d0f145f9fe983af introduced undump method which requires ruby 2.5+. Chef infra client bundles ruby with it and 13th version has only 2.4.5 ruby.

    ================================================================================
    Error executing action `set_permissions` on resource 'rabbitmq_user[user]'
    ================================================================================

    NoMethodError
    -------------
    undefined method `undump' for "\"user\t.*\t.*\t.*\n\"":String

    Cookbook Trace:
    ---------------
    /var/chef/cache/cookbooks/rabbitmq/providers/user.rb:86:in `user_has_expected_permissions?'
    /var/chef/cache/cookbooks/rabbitmq/providers/user.rb:129:in `block (2 levels) in class_from_file'
    /var/chef/cache/cookbooks/rabbitmq/providers/user.rb:129:in `reject'
    /var/chef/cache/cookbooks/rabbitmq/providers/user.rb:129:in `block in class_from_file'

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/wrapper_rabbitmq/recipes/default.rb:79:in `block in from_file'

    rabbitmq_user("tuser") do
      action [:add, :set_permissions]
      default_guard_interpreter :default
      declared_type :rabbitmq_user
      cookbook_name "test_user
      recipe_name "default"
      vhost "test"
      permissions ".* .* .*"
    end

I suppose it's either bump compat for this cookbook or rework that undump method?

michaelklishin commented 2 years ago

If you understand how we can rework the method for Ruby 2.4 compat, please submit a PR. Otherwise we can bump compatibility in cookbook's metadata.

fr33l commented 2 years ago

If you understand how we can rework the method for Ruby 2.4 compat,

Unfortunately, I don't.

Otherwise we can bump compatibility in cookbook's metadata.

:+1: