aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Roullit <emmanuel.roullit@gmail.com>2020-05-26 20:22:07 +0200
committerJake Hunsaker <jhunsake@redhat.com>2020-06-02 11:24:00 -0400
commit8ce28d1caf3ec943da3f02d27e846b914e8dd5a7 (patch)
treeafc90cb2f5b71921e3b8853d1055698060da90c1
parentb046c916be828660359bf30a61b8ff5a9822affc (diff)
downloadsos-8ce28d1caf3ec943da3f02d27e846b914e8dd5a7.tar.gz
[dnf] Assume no for dnf commands
dnf could wait for some interactive input from a user. Use --assumeno, to keep going without modifying dnf's state. Resolves: #2091 Signed-off-by: Emmanuel Roullit <emmanuel.roullit@gmail.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/report/plugins/dnf.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/sos/report/plugins/dnf.py b/sos/report/plugins/dnf.py
index 33ee1325..03db7847 100644
--- a/sos/report/plugins/dnf.py
+++ b/sos/report/plugins/dnf.py
@@ -34,7 +34,7 @@ class DNFPlugin(Plugin, RedHatPlugin):
if "[i]" in line:
module = line.split()[0]
if module != "Hint:":
- self.add_cmd_output("dnf module info " + module)
+ self.add_cmd_output("dnf --assumeno module info " + module)
def setup(self):
self.add_copy_spec("/etc/dnf/")
@@ -48,9 +48,9 @@ class DNFPlugin(Plugin, RedHatPlugin):
self.add_cmd_output([
"dnf --version",
- "dnf list installed *dnf*",
- "dnf list extras",
- "dnf module list",
+ "dnf --assumeno list installed *dnf*",
+ "dnf --assumeno list extras",
+ "dnf --assumeno module list",
"package-cleanup --dupes",
"package-cleanup --problems"
])
@@ -72,7 +72,8 @@ class DNFPlugin(Plugin, RedHatPlugin):
self.add_cmd_output("dnf history info %d" % tr_id)
# Get list of dnf installed modules and their details.
- modules = self.collect_cmd_output("dnf module list --installed")
+ module_cmd = "dnf --assumeno module list --installed"
+ modules = self.collect_cmd_output(module_cmd)
self.get_modules_info(modules['output'])
# vim: set et ts=4 sw=4 :