diff --git a/CHANGELOG.md b/CHANGELOG.md index 342c3b6d1..725468f01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Support for Shield/X-Pack logging configuration file added. #### Fixes +* Fixed a bug that prevented plugins from being updated properly. ## 5.1.1 (April 13, 2017) diff --git a/lib/puppet/provider/elastic_plugin.rb b/lib/puppet/provider/elastic_plugin.rb index 3996091b5..f4e6a6df1 100644 --- a/lib/puppet/provider/elastic_plugin.rb +++ b/lib/puppet/provider/elastic_plugin.rb @@ -140,7 +140,7 @@ def create def destroy with_environment do - plugin(['remove', @resource[:name]]) + plugin(['remove', Puppet_X::Elastic::plugin_name(@resource[:name])]) end end diff --git a/spec/unit/provider/elasticsearch_plugin/shared_examples.rb b/spec/unit/provider/elasticsearch_plugin/shared_examples.rb index d79337a92..51063faaa 100644 --- a/spec/unit/provider/elasticsearch_plugin/shared_examples.rb +++ b/spec/unit/provider/elasticsearch_plugin/shared_examples.rb @@ -124,7 +124,9 @@ describe 'removal' do it 'uninstalls the plugin' do - provider.expects(:plugin).with(['remove', resource_name]) + provider.expects(:plugin).with( + ['remove', resource_name.split('-').last] + ) provider.destroy end end