You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.8 KiB
53 lines
1.8 KiB
6 years ago
|
From 8cf4f5cb49ac3742c0c650f81875872ac3e09fbb Mon Sep 17 00:00:00 2001
|
||
6 years ago
|
From: Alex Schultz <aschultz@redhat.com>
|
||
|
Date: Wed, 3 Oct 2018 12:55:30 -0600
|
||
6 years ago
|
Subject: [PATCH 5/5] (PUP-9198) Add RHEL8 support in the dnf provider
|
||
6 years ago
|
|
||
|
dnf should be the default for RHEL8
|
||
|
---
|
||
|
lib/puppet/provider/package/dnf.rb | 1 +
|
||
|
spec/unit/provider/package/dnf_spec.rb | 15 +++++++++++++++
|
||
|
2 files changed, 16 insertions(+)
|
||
|
|
||
|
diff --git a/lib/puppet/provider/package/dnf.rb b/lib/puppet/provider/package/dnf.rb
|
||
6 years ago
|
index c0ed877..ee27322 100644
|
||
6 years ago
|
--- a/lib/puppet/provider/package/dnf.rb
|
||
|
+++ b/lib/puppet/provider/package/dnf.rb
|
||
6 years ago
|
@@ -29,6 +29,7 @@ Puppet::Type.type(:package).provide :dnf, :parent => :yum do
|
||
6 years ago
|
end
|
||
|
|
||
6 years ago
|
defaultfor :operatingsystem => :fedora
|
||
6 years ago
|
+ defaultfor :osfamily => :redhat, :operatingsystemmajrelease => ["8"]
|
||
|
|
||
|
def self.update_command
|
||
|
# In DNF, update is deprecated for upgrade
|
||
|
diff --git a/spec/unit/provider/package/dnf_spec.rb b/spec/unit/provider/package/dnf_spec.rb
|
||
6 years ago
|
index 5e57337..40345dc 100644
|
||
6 years ago
|
--- a/spec/unit/provider/package/dnf_spec.rb
|
||
|
+++ b/spec/unit/provider/package/dnf_spec.rb
|
||
6 years ago
|
@@ -23,6 +23,21 @@ context 'default' do
|
||
6 years ago
|
expect(provider_class).to be_default
|
||
|
end
|
||
|
end
|
||
|
+
|
||
|
+ it "should not be the default provider on rhel7" do
|
||
|
+ Facter.stubs(:value).with(:osfamily).returns(:redhat)
|
||
|
+ Facter.stubs(:value).with(:operatingsystem).returns(:redhat)
|
||
|
+ Facter.stubs(:value).with(:operatingsystemmajrelease).returns("7")
|
||
|
+ expect(provider_class).to_not be_default
|
||
|
+ end
|
||
|
+
|
||
|
+ it "should be the default provider on rhel8" do
|
||
|
+ Facter.stubs(:value).with(:osfamily).returns(:redhat)
|
||
|
+ Facter.stubs(:value).with(:operatingsystem).returns(:redhat)
|
||
|
+ Facter.stubs(:value).with(:operatingsystemmajrelease).returns("8")
|
||
|
+ expect(provider_class).to be_default
|
||
|
+ end
|
||
|
+
|
||
|
end
|
||
|
|
||
|
describe provider_class do
|
||
6 years ago
|
--
|
||
|
2.19.2
|
||
|
|