Skip to content

Commit 69b286c

Browse files
committed
Add assumeyes option to dnf module list
1 parent f9bcd09 commit 69b286c

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
@@ -35,7 +35,7 @@ def self.prefetch(packages)
3535

3636
def self.instances
3737
packages = []
38-
cmd = "#{command(:dnf)} module list -d 0 -e #{error_level}"
38+
cmd = "#{command(:dnf)} module list -y -d 0 -e #{error_level}"
3939
execute(cmd).each_line do |line|
4040
# select only lines with actual packages since DNF clutters the output
4141
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)