Skip to content

Commit

Permalink
Merge pull request #9278 from puppetlabs/backport-9225-to-7.x
Browse files Browse the repository at this point in the history
[Backport 7.x] Fixes #9224: Add assumeyes option to dnf module list
  • Loading branch information
joshcooper committed Mar 2, 2024
2 parents b0f8ccf + 3c89fb1 commit 609e42c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/puppet/provider/package/dnfmodule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def self.prefetch(packages)

def self.instances
packages = []
cmd = "#{command(:dnf)} module list -d 0 -e #{error_level}"
cmd = "#{command(:dnf)} module list -y -d 0 -e #{error_level}"
execute(cmd).each_line do |line|
# select only lines with actual packages since DNF clutters the output
next unless line =~ /\[[eix]\][, ]/
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/provider/package/dnfmodule_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
it "does not try to disable if package is already disabled" do
allow(described_class).to receive(:command).with(:dnf).and_return(dnf_path)
allow(Puppet::Util::Execution).to receive(:execute)
.with("/usr/bin/dnf module list -d 0 -e 1")
.with("/usr/bin/dnf module list -y -d 0 -e 1")
.and_return("baz 1.2 [d][x] common [d], complete Package Description")
resource[:ensure] = :disabled
expect(provider).to be_insync(:disabled)
Expand All @@ -254,7 +254,7 @@

it "returns an array of enabled modules" do
allow(Puppet::Util::Execution).to receive(:execute)
.with("/usr/bin/dnf module list -d 0 -e 1")
.with("/usr/bin/dnf module list -y -d 0 -e 1")
.and_return(packages)

enabled_packages = described_class.instances.map { |package| package.properties }
Expand Down

0 comments on commit 609e42c

Please sign in to comment.