Skip to content
  • Lance Albertson's avatar
    Fix Chef 16 issue with plugin resource · 9c061c07
    Lance Albertson authored
    
    
    It appears that ruby-2.7 (which ships with Chef 16) likely doesn't like
    ``0022`` as an integer and is causing issues on Chef 16. To workaround the
    issue, we can simply change this to a string.
    
    The following is the output of the original error I've been hitting.
    
    ```
    Recipe: rabbitmq::management_ui
      * rabbitmq_plugin[rabbitmq_management] action enable
        * execute[rabbitmq-plugins enable rabbitmq_management] action run
    
          ================================================================================
          Error executing action `run` on resource 'execute[rabbitmq-plugins enable rabbitmq_management]'
          ================================================================================
    
          TypeError
          ---------
          no implicit conversion from nil to integer
    
          Resource Declaration:
          ---------------------
          # In /tmp/kitchen/cache/cookbooks/rabbitmq/providers/plugin.rb
    
    37:     execute "rabbitmq-plugins enable #{new_resource.plugin}" do
    38:       umask 0022
    39:       Chef::Log.info "Enabling RabbitMQ plugin '#{new_resource.plugin}'."
    40:       environment shell_environment.merge(
    41:         'PATH' => "#{ENV['PATH']}:/usr/lib/rabbitmq/bin"
    42:       )
    43:       new_resource.updated_by_last_action(true)
    44:     end
    45:   end
    ```
    
    Signed-off-by: default avatarLance Albertson <lance@osuosl.org>
    9c061c07