diff --git a/lib/puppet/provider/package/dnfmodule.rb b/lib/puppet/provider/package/dnfmodule.rb index 710fd806bbb..7b79b0a3f48 100644 --- a/lib/puppet/provider/package/dnfmodule.rb +++ b/lib/puppet/provider/package/dnfmodule.rb @@ -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]\][, ]/ diff --git a/spec/unit/provider/package/dnfmodule_spec.rb b/spec/unit/provider/package/dnfmodule_spec.rb index 4cb00136d5c..97b499f7f84 100644 --- a/spec/unit/provider/package/dnfmodule_spec.rb +++ b/spec/unit/provider/package/dnfmodule_spec.rb @@ -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) @@ -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 }