kickstart.py | 4 ++-- ui/gui/spokes/custom.py | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-)
Resolves: rhbz#1027224 --- pyanaconda/ui/gui/spokes/custom.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index 546ac94..7a75e85 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -1901,6 +1901,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): fancy_set_sensitive(self._encryptCheckbox, True)
def run_container_editor(self, container=None, name=None): + """ Run container edit dialog and return True if changes were made. """ size = Size(0) size_policy = self._device_container_size if container: @@ -1969,6 +1970,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): self._device_container_raid_level = dialog.raid_level self._device_container_encrypted = dialog.encrypted self._device_container_size = dialog.size_policy + return True
def _container_store_row(self, name, freeSpace=None): if freeSpace is not None: @@ -1982,7 +1984,8 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
# pass the name along with any found vg since we could be modifying a # vg that hasn't been instantiated yet - self.run_container_editor(container=container, name=container_name) + if not self.run_container_editor(container=container, name=container_name): + return
log.debug("%s -> %s", container_name, self._device_container_name) if container_name == self._device_container_name: @@ -2049,9 +2052,9 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): # run the vg editor dialog with a default name and disk set hostname = self.data.network.hostname name = self._storage_playground.suggestContainerName(hostname=hostname) - self.run_container_editor(name=name) + new = self.run_container_editor(name=name) for idx, data in enumerate(self._containerStore): - if data[0] == new_text: + if new and data[0] == new_text: c = self._storage_playground.devicetree.getDeviceByName(self._device_container_name) freeSpace = getattr(c, "freeSpace", None) row = self._container_store_row(self._device_container_name, freeSpace) @@ -2059,6 +2062,9 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): self._containerStore.insert(idx, row) combo.set_active(idx) # triggers a call to this method return + elif not new and data[0] == self._device_container_name: + combo.set_active(idx) + return else: self._device_container_name = container_name
Resolves: rhbz#1072285 --- pyanaconda/kickstart.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py index 9103d25..4c90d4e 100644 --- a/pyanaconda/kickstart.py +++ b/pyanaconda/kickstart.py @@ -26,7 +26,7 @@ from blivet.devicelibs import swap as swap_lib from blivet.formats import getFormat from blivet.partitioning import doPartitioning from blivet.partitioning import growLVM -from blivet.errors import PartitioningError +from blivet.errors import PartitioningError, StorageError from blivet.size import Size from blivet import udev from blivet.platform import platform @@ -1830,7 +1830,7 @@ def preScriptPass(f):
try: ksparser.readKickstart(f) - except KickstartError as e: + except (KickstartError, StorageError, ValueError) as e: # We do not have an interface here yet, so we cannot use our error # handling callback. print(e)
----- Original Message -----
From: "David Lehman" dlehman@redhat.com To: anaconda-patches@lists.fedorahosted.org Sent: Tuesday, September 16, 2014 12:30:48 PM Subject: [PATCH 2/2] Catch errors from blivet when parsing kickstart.
Resolves: rhbz#1072285
pyanaconda/kickstart.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py index 9103d25..4c90d4e 100644 --- a/pyanaconda/kickstart.py +++ b/pyanaconda/kickstart.py @@ -26,7 +26,7 @@ from blivet.devicelibs import swap as swap_lib from blivet.formats import getFormat from blivet.partitioning import doPartitioning from blivet.partitioning import growLVM -from blivet.errors import PartitioningError +from blivet.errors import PartitioningError, StorageError from blivet.size import Size from blivet import udev from blivet.platform import platform @@ -1830,7 +1830,7 @@ def preScriptPass(f):
try: ksparser.readKickstart(f)
- except KickstartError as e:
- except (KickstartError, StorageError, ValueError) as e: # We do not have an interface here yet, so we cannot use our error # handling callback. print(e)
-- 1.9.3
anaconda-patches mailing list anaconda-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
There's an opportunity to reexamine few rethrows of ValueErrors and StorageErrors as KickstartErrors in Iscsi, LogVolData, PartitionData, RaidData classes.
- mulhern
----- Original Message -----
From: "Anne Mulhern" amulhern@redhat.com To: "anaconda patch review" anaconda-patches@lists.fedorahosted.org Sent: Tuesday, September 16, 2014 1:52:37 PM Subject: Re: [PATCH 2/2] Catch errors from blivet when parsing kickstart.
----- Original Message -----
From: "David Lehman" dlehman@redhat.com To: anaconda-patches@lists.fedorahosted.org Sent: Tuesday, September 16, 2014 12:30:48 PM Subject: [PATCH 2/2] Catch errors from blivet when parsing kickstart.
Resolves: rhbz#1072285
pyanaconda/kickstart.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py index 9103d25..4c90d4e 100644 --- a/pyanaconda/kickstart.py +++ b/pyanaconda/kickstart.py @@ -26,7 +26,7 @@ from blivet.devicelibs import swap as swap_lib from blivet.formats import getFormat from blivet.partitioning import doPartitioning from blivet.partitioning import growLVM -from blivet.errors import PartitioningError +from blivet.errors import PartitioningError, StorageError from blivet.size import Size from blivet import udev from blivet.platform import platform @@ -1830,7 +1830,7 @@ def preScriptPass(f):
try: ksparser.readKickstart(f)
- except KickstartError as e:
- except (KickstartError, StorageError, ValueError) as e: # We do not have an interface here yet, so we cannot use our error # handling callback. print(e)
-- 1.9.3
anaconda-patches mailing list anaconda-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
There's an opportunity to reexamine few rethrows of ValueErrors and StorageErrors as KickstartErrors in Iscsi, LogVolData, PartitionData, RaidData classes.
- mulhern
anaconda-patches mailing list anaconda-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
Actually, I realized there is a problem here which is somewhat significant. If Value- and Storage- Errors are caught and rethrown as KickstartErrors the line number information is propagated, this way, it is not and the user is not pointed at the line that failed.
- mulhern
anaconda-patches@lists.fedorahosted.org