Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PUP-9198) Add RHEL8 support in the dnf provider #7140

Merged
merged 1 commit into from
Oct 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/puppet/provider/package/dnf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
end

defaultfor :operatingsystem => :fedora, :operatingsystemmajrelease => (22..30).to_a
defaultfor :osfamily => :redhat, :operatingsystemmajrelease => ["8"]

def self.update_command
# In DNF, update is deprecated for upgrade
Expand Down
15 changes: 15 additions & 0 deletions spec/unit/provider/package/dnf_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@
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
Expand Down