...
 
Commits (2)
  • 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
  • Michael Klishin's avatar
    Merge pull request #561 from ramereth/ramereth/plugin-umask-fix-5.x · 70fa62fe
    Michael Klishin authored
    Fix Chef 16 issue with plugin resource
    70fa62fe
......@@ -39,7 +39,7 @@ end
action :enable do
unless plugin_enabled?(new_resource.plugin)
execute "rabbitmq-plugins enable #{new_resource.plugin}" do
umask 0022
umask '0022'
Chef::Log.info "Enabling RabbitMQ plugin '#{new_resource.plugin}'."
environment shell_environment.merge(
'PATH' => "#{ENV['PATH']}:/usr/lib/rabbitmq/bin"
......@@ -52,7 +52,7 @@ end
action :disable do
if plugin_enabled?(new_resource.plugin)
execute "rabbitmq-plugins disable #{new_resource.plugin}" do
umask 0022
umask '0022'
Chef::Log.info "Disabling RabbitMQ plugin '#{new_resource.plugin}'."
environment shell_environment.merge(
'PATH' => "#{ENV['PATH']}:/usr/lib/rabbitmq/bin"
......