Skip to content

Commit

Permalink
Add missing notifies for ohai[reload_packages] on Fedora/RHEL
Browse files Browse the repository at this point in the history
Without this, it doesn't properly run ``installed_rabbitmq_version`` and causes
an error:

```
  * ohai[reload_packages] action nothing (skipped due to action :nothing)
Recipe: rabbitmq::management_ui
  * rabbitmq_plugin[rabbitmq_management] action enable

    ================================================================================
    Error executing action `enable` on resource 'rabbitmq_plugin[rabbitmq_management]'
    ================================================================================

    NoMethodError
    -------------
    undefined method `[]' for nil:NilClass

    Cookbook Trace: (most recent call first)
    ----------------------------------------
    /tmp/kitchen/cache/cookbooks/rabbitmq/libraries/default.rb:79:in `installed_rabbitmq_version'
    /tmp/kitchen/cache/cookbooks/rabbitmq/providers/plugin.rb:26:in `plugin_enabled?'
    /tmp/kitchen/cache/cookbooks/rabbitmq/providers/plugin.rb:40:in `block in class_from_file'
```

Signed-off-by: Lance Albertson <[email protected]>
  • Loading branch information
ramereth committed Jul 17, 2020
1 parent 70fa62f commit 2421f2f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ class Chef::Recipe
package 'rabbitmq-server' do
action :install
version node['rabbitmq']['version'] if node['rabbitmq']['pin_distro_version']
notifies :reload, 'ohai[reload_packages]', :immediately
end
else
remote_file "#{Chef::Config[:file_cache_path]}/#{rpm_package_name}" do
Expand Down Expand Up @@ -213,6 +214,7 @@ class Chef::Recipe
package 'rabbitmq-server' do
action :install
version node['rabbitmq']['version'] if node['rabbitmq']['pin_distro_version']
notifies :reload, 'ohai[reload_packages]', :immediately
end
else
remote_file "#{Chef::Config[:file_cache_path]}/#{rpm_package_name}" do
Expand Down

0 comments on commit 2421f2f

Please sign in to comment.