summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-03-07 11:08:46 -0800
committerGitHub <noreply@github.com>2018-03-07 11:08:46 -0800
commit62dca7c0ff16aaf1ed860285e644cb2b6c8b0552 (patch)
tree99ca6d265ce5b0bdb85d3e0148fdf48d5814219c
parent640283a5157016ca0f9ce3a91005c9b073ad8828 (diff)
parentdabd2413e08794aa46726a573183d4b8e5830514 (diff)
downloadchef-62dca7c0ff16aaf1ed860285e644cb2b6c8b0552.tar.gz
Merge pull request #6956 from chef/bff
Rename bff provider to match its resource
-rw-r--r--lib/chef/provider/package/bff.rb (renamed from lib/chef/provider/package/aix.rb)4
-rw-r--r--lib/chef/providers.rb2
-rw-r--r--lib/chef/resource/bff_package.rb4
-rw-r--r--spec/unit/provider/package/bff_spec.rb (renamed from spec/unit/provider/package/aix_spec.rb)8
-rw-r--r--spec/unit/provider_resolver_spec.rb6
5 files changed, 12 insertions, 12 deletions
diff --git a/lib/chef/provider/package/aix.rb b/lib/chef/provider/package/bff.rb
index b013b3d8ce..9a2ccd25b4 100644
--- a/lib/chef/provider/package/aix.rb
+++ b/lib/chef/provider/package/bff.rb
@@ -23,10 +23,10 @@ require "chef/mixin/get_source_from_package"
class Chef
class Provider
class Package
- class Aix < Chef::Provider::Package
+ class Bff < Chef::Provider::Package
provides :package, os: "aix"
- provides :bff_package, os: "aix"
+ provides :bff_package
include Chef::Mixin::GetSourceFromPackage
diff --git a/lib/chef/providers.rb b/lib/chef/providers.rb
index 8b07e1b405..1b9aa84697 100644
--- a/lib/chef/providers.rb
+++ b/lib/chef/providers.rb
@@ -81,7 +81,7 @@ require "chef/provider/package/yum"
require "chef/provider/package/zypper"
require "chef/provider/package/solaris"
require "chef/provider/package/smartos"
-require "chef/provider/package/aix"
+require "chef/provider/package/bff"
require "chef/provider/package/cab"
require "chef/provider/package/powershell"
require "chef/provider/package/msu"
diff --git a/lib/chef/resource/bff_package.rb b/lib/chef/resource/bff_package.rb
index f67d6d253e..62838cfd60 100644
--- a/lib/chef/resource/bff_package.rb
+++ b/lib/chef/resource/bff_package.rb
@@ -17,11 +17,13 @@
#
require "chef/resource/package"
-require "chef/provider/package/aix"
class Chef
class Resource
class BffPackage < Chef::Resource::Package
+ resource_name :bff_package
+ provides :bff_package
+
description "Use the bff_package resource to manage packages for the AIX platform"\
" using the installp utility. When a package is installed from a local"\
" file, it must be added to the node using the remote_file or cookbook_file"\
diff --git a/spec/unit/provider/package/aix_spec.rb b/spec/unit/provider/package/bff_spec.rb
index 3c54c6a80c..1018f2d3e9 100644
--- a/spec/unit/provider/package/aix_spec.rb
+++ b/spec/unit/provider/package/bff_spec.rb
@@ -18,7 +18,7 @@
#
require "spec_helper"
-describe Chef::Provider::Package::Aix do
+describe Chef::Provider::Package::Bff do
before(:each) do
@node = Chef::Node.new
@events = Chef::EventDispatch::Dispatcher.new
@@ -27,7 +27,7 @@ describe Chef::Provider::Package::Aix do
@new_resource = Chef::Resource::Package.new("samba.base")
@new_resource.source("/tmp/samba.base")
- @provider = Chef::Provider::Package::Aix.new(@new_resource, @run_context)
+ @provider = Chef::Provider::Package::Bff.new(@new_resource, @run_context)
allow(::File).to receive(:exist?).with(@new_resource.source).and_return(true)
end
@@ -99,7 +99,7 @@ describe Chef::Provider::Package::Aix do
it "should raise an exception if the source is not set but we are installing" do
status = double("Status", :stdout => "", :exitstatus => 1, :format_for_exception => "")
@new_resource = Chef::Resource::Package.new("samba.base")
- @provider = Chef::Provider::Package::Aix.new(@new_resource, @run_context)
+ @provider = Chef::Provider::Package::Bff.new(@new_resource, @run_context)
allow(@provider).to receive(:shell_out).and_return(status)
expect { @provider.run_action(:install) }.to raise_error(Chef::Exceptions::Package)
end
@@ -156,7 +156,7 @@ describe Chef::Provider::Package::Aix do
it "should run installp -aYF -d when the package is a path to install" do
@new_resource = Chef::Resource::Package.new("/tmp/samba.base")
- @provider = Chef::Provider::Package::Aix.new(@new_resource, @run_context)
+ @provider = Chef::Provider::Package::Bff.new(@new_resource, @run_context)
expect(@new_resource.source).to eq("/tmp/samba.base")
expect(@provider).to receive(:shell_out!).with("installp", "-aYF", "-d", "/tmp/samba.base", "/tmp/samba.base", timeout: 900)
@provider.install_package("/tmp/samba.base", "3.3.12.0")
diff --git a/spec/unit/provider_resolver_spec.rb b/spec/unit/provider_resolver_spec.rb
index ac641de43a..6fa05c936a 100644
--- a/spec/unit/provider_resolver_spec.rb
+++ b/spec/unit/provider_resolver_spec.rb
@@ -554,6 +554,7 @@ describe Chef::ProviderResolver do
PROVIDERS =
{
bash: [ Chef::Resource::Bash, Chef::Provider::Script ],
+ bff_package: [ Chef::Resource::BffPackage, Chef::Provider::Package::Bff ],
breakpoint: [ Chef::Resource::Breakpoint, Chef::Resource::Breakpoint.action_class ],
chef_gem: [ Chef::Resource::ChefGem, Chef::Provider::Package::Rubygems ],
cookbook_file: [ Chef::Resource::CookbookFile, Chef::Provider::CookbookFile ],
@@ -592,7 +593,6 @@ describe Chef::ProviderResolver do
# We want to check that these are unsupported:
apt_package: nil,
- bff_package: nil,
dpkg_package: nil,
dsc_script: nil,
ips_package: nil,
@@ -781,13 +781,11 @@ describe Chef::ProviderResolver do
},
"aix" => {
- bff_package: [ Chef::Resource::BffPackage, Chef::Provider::Package::Aix ],
cron: [ Chef::Resource::Cron, Chef::Provider::Cron::Aix ],
group: [ Chef::Resource::Group, Chef::Provider::Group::Aix ],
ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig::Aix ],
mount: [ Chef::Resource::Mount, Chef::Provider::Mount::Aix ],
- # TODO should be Chef::Resource::BffPackage
- package: [ Chef::Resource::Package, Chef::Provider::Package::Aix ],
+ package: [ Chef::Resource::Package, Chef::Provider::Package::Bff ],
rpm_package: [ Chef::Resource::RpmPackage, Chef::Provider::Package::Rpm ],
user: [ Chef::Resource::User::AixUser, Chef::Provider::User::Aix ],
# service: [ Chef::Resource::AixService, Chef::Provider::Service::Aix ],