Skip to content

Commit 609e42c

Browse files
authored
Merge pull request #9278 from puppetlabs/backport-9225-to-7.x
[Backport 7.x] Fixes #9224: Add assumeyes option to dnf module list
2 parents b0f8ccf + 3c89fb1 commit 609e42c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/puppet/provider/package/dnfmodule.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def self.prefetch(packages)
3434

3535
def self.instances
3636
packages = []
37-
cmd = "#{command(:dnf)} module list -d 0 -e #{error_level}"
37+
cmd = "#{command(:dnf)} module list -y -d 0 -e #{error_level}"
3838
execute(cmd).each_line do |line|
3939
# select only lines with actual packages since DNF clutters the output
4040
next unless line =~ /\[[eix]\][, ]/

spec/unit/provider/package/dnfmodule_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@
241241
it "does not try to disable if package is already disabled" do
242242
allow(described_class).to receive(:command).with(:dnf).and_return(dnf_path)
243243
allow(Puppet::Util::Execution).to receive(:execute)
244-
.with("/usr/bin/dnf module list -d 0 -e 1")
244+
.with("/usr/bin/dnf module list -y -d 0 -e 1")
245245
.and_return("baz 1.2 [d][x] common [d], complete Package Description")
246246
resource[:ensure] = :disabled
247247
expect(provider).to be_insync(:disabled)
@@ -254,7 +254,7 @@
254254

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

260260
enabled_packages = described_class.instances.map { |package| package.properties }

0 commit comments

Comments
 (0)