Martin Kolman 199746
From 63ef4aa583fd36434b91420a04fad4e121752ea0 Mon Sep 17 00:00:00 2001
Martin Kolman 199746
From: Jiri Konecny <jkonecny@redhat.com>
Martin Kolman 199746
Date: Thu, 26 Oct 2017 11:26:56 +0200
Martin Kolman 199746
Subject: [PATCH] Add logging to TUI software selection spoke (#1505090)
Martin Kolman 199746
Martin Kolman 199746
Related: rhbz#1505090
Martin Kolman 199746
---
Martin Kolman 199746
 pyanaconda/ui/tui/spokes/software_selection.py | 10 ++++++++++
Martin Kolman 199746
 1 file changed, 10 insertions(+)
Martin Kolman 199746
Martin Kolman 199746
diff --git a/pyanaconda/ui/tui/spokes/software_selection.py b/pyanaconda/ui/tui/spokes/software_selection.py
Martin Kolman 199746
index ae35838d0..93c868f32 100644
Martin Kolman 199746
--- a/pyanaconda/ui/tui/spokes/software_selection.py
Martin Kolman 199746
+++ b/pyanaconda/ui/tui/spokes/software_selection.py
Martin Kolman 199746
@@ -33,6 +33,9 @@ from simpleline.render.screen import InputState
Martin Kolman 199746
 from simpleline.render.screen_handler import ScreenHandler
Martin Kolman 199746
 from simpleline.render.widgets import TextWidget, CheckboxWidget
Martin Kolman 199746
 
Martin Kolman 199746
+from pyanaconda.anaconda_loggers import get_module_logger
Martin Kolman 199746
+log = get_module_logger(__name__)
Martin Kolman 199746
+
Martin Kolman 199746
 __all__ = ["SoftwareSpoke"]
Martin Kolman 199746
 
Martin Kolman 199746
 
Martin Kolman 199746
@@ -113,6 +116,7 @@ class SoftwareSpoke(NormalTUISpoke):
Martin Kolman 199746
     def _payload_finished(self):
Martin Kolman 199746
         self.environment = self.data.packages.environment
Martin Kolman 199746
         self.addons = self._get_selected_addons()
Martin Kolman 199746
+        log.debug("Payload restarted, set new info and clear the old one.")
Martin Kolman 199746
 
Martin Kolman 199746
     def _payload_error(self):
Martin Kolman 199746
         self.errors = [payloadMgr.error]
Martin Kolman 199746
@@ -288,6 +292,8 @@ class SoftwareSpoke(NormalTUISpoke):
Martin Kolman 199746
         self.environment = self._selected_environment
Martin Kolman 199746
         self.addons = self._addons_selection if self.environment is not None else set()
Martin Kolman 199746
 
Martin Kolman 199746
+        log.debug("Apply called old env %s, new env %s and addons %s", self._origEnv, self.environment, self.addons)
Martin Kolman 199746
+
Martin Kolman 199746
         if self.environment is None:
Martin Kolman 199746
             return
Martin Kolman 199746
 
Martin Kolman 199746
@@ -301,6 +307,9 @@ class SoftwareSpoke(NormalTUISpoke):
Martin Kolman 199746
                     or self._origEnv != self.environment \
Martin Kolman 199746
                     or set(self._origAddons) != set(self.addons):
Martin Kolman 199746
 
Martin Kolman 199746
+                log.debug("Setting new software selection old env %s, new env %s and addons %s",
Martin Kolman 199746
+                          self._origEnv, self.environment, self.addons)
Martin Kolman 199746
+
Martin Kolman 199746
                 self.payload.data.packages.packageList = []
Martin Kolman 199746
                 self.data.packages.groupList = []
Martin Kolman 199746
                 self.payload.selectEnvironment(self.environment)
Martin Kolman 199746
@@ -329,6 +338,7 @@ class SoftwareSpoke(NormalTUISpoke):
Martin Kolman 199746
         except DependencyError as e:
Martin Kolman 199746
             self.errors = [str(e)]
Martin Kolman 199746
             self._tx_id = None
Martin Kolman 199746
+            log.warning("Transaction error %s", str(e))
Martin Kolman 199746
         else:
Martin Kolman 199746
             self._tx_id = self.payload.txID
Martin Kolman 199746
 
Martin Kolman 199746
-- 
Martin Kolman 199746
2.13.6
Martin Kolman 199746