diff options
-rw-r--r-- | sos/plugins/dnf.py | 16 | ||||
-rw-r--r-- | sos/plugins/yum.py | 17 |
2 files changed, 31 insertions, 2 deletions
diff --git a/sos/plugins/dnf.py b/sos/plugins/dnf.py index c371d67b..c2198ae9 100644 --- a/sos/plugins/dnf.py +++ b/sos/plugins/dnf.py @@ -26,7 +26,8 @@ class DNFPlugin(Plugin, RedHatPlugin): packages = ('dnf',) option_list = [ - ("history", "captures transaction history", "fast", False) + ("history", "captures transaction history", "fast", False), + ("history-info", "detailed transaction history", "slow", False), ] def setup(self): @@ -60,4 +61,17 @@ class DNFPlugin(Plugin, RedHatPlugin): if self.get_option("history"): self.add_cmd_output("dnf history") + if self.get_option("history-info"): + history = self.call_ext_prog("dnf history") + transactions = None + if history['output']: + for line in history['output'].splitlines(): + try: + transactions = int(line.split('|')[0].strip()) + break + except ValueError: + pass + for tr_id in range(1, transactions+1): + self.add_cmd_output("dnf history info %d" % tr_id) + # vim: set et ts=4 sw=4 : diff --git a/sos/plugins/yum.py b/sos/plugins/yum.py index 555a3508..92626a33 100644 --- a/sos/plugins/yum.py +++ b/sos/plugins/yum.py @@ -27,7 +27,8 @@ class Yum(Plugin, RedHatPlugin): option_list = [ ("yumlist", "list repositories and packages", "slow", False), - ("yumdebug", "gather yum debugging data", "slow", False) + ("yumdebug", "gather yum debugging data", "slow", False), + ("yum-history-info", "gather yum history info", "slow", False), ] def setup(self): @@ -52,6 +53,20 @@ class Yum(Plugin, RedHatPlugin): ]) self.add_cmd_output("yum history") + # packages installed/erased/updated per transaction + if self.get_option("yum-history-info"): + history = self.call_ext_prog("yum history") + transactions = None + if history['output']: + for line in history['output'].splitlines(): + try: + transactions = int(line.split('|')[0].strip()) + break + except ValueError: + pass + for tr_id in range(1, transactions+1): + self.add_cmd_output("yum history info %d" % tr_id) + if self.get_option("yumlist"): # List various information about available packages self.add_cmd_output("yum list") |