[PATCH] Check that the addon selection state exists before reading it
David Shea
dshea at redhat.com
Thu Feb 27 22:27:08 UTC 2014
An addon state may not be present if switching from an installation
source with a different set of groups.
---
pyanaconda/ui/gui/spokes/software.py | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py
index bfae3ae..6302827 100644
--- a/pyanaconda/ui/gui/spokes/software.py
+++ b/pyanaconda/ui/gui/spokes/software.py
@@ -309,13 +309,16 @@ class SoftwareSelectionSpoke(NormalSpoke):
def _addAddon(self, grp):
(name, desc) = self.payload.groupDescription(grp)
- # If the add-on was previously selected by the user, select it
- if self._addonStates[grp] == self._ADDON_SELECTED:
- selected = True
- # If the add-on was previously de-selected by the user, de-select it
- elif self._addonStates[grp] == self._ADDON_DESELECTED:
- selected = False
- # Otherwise, use the default state
+ if grp in self._addonStates:
+ # If the add-on was previously selected by the user, select it
+ if self._addonStates[grp] == self._ADDON_SELECTED:
+ selected = True
+ # If the add-on was previously de-selected by the user, de-select it
+ elif self._addonStates[grp] == self._ADDON_DESELECTED:
+ selected = False
+ # Otherwise, use the default state
+ else:
+ selected = self.payload.environmentOptionIsDefault(self.environment, grp)
else:
selected = self.payload.environmentOptionIsDefault(self.environment, grp)
--
1.8.5.3
More information about the anaconda-patches
mailing list