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

Fixes #9224: Add assumeyes option to dnf module list #9225

Merged
merged 1 commit into from
Mar 1, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/puppet/provider/package/dnfmodule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,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
Loading