[PATCH 3/8] Correctly handle the default vg not having been instantiated yet.
Brian C. Lane
bcl at redhat.com
Thu Nov 29 22:31:34 UTC 2012
On Thu, Nov 29, 2012 at 11:19:27AM -0600, David Lehman wrote:
> When editing a non-lv and changing the device type type to lvm it is
> possible that there are no vg instances in the devicetree.
> ---
> pyanaconda/ui/gui/spokes/custom.py | 9 ++++++++-
> 1 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
> index 39327c1..29643bf 100644
> --- a/pyanaconda/ui/gui/spokes/custom.py
> +++ b/pyanaconda/ui/gui/spokes/custom.py
> @@ -2222,6 +2222,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
> container = self.__storage.getContainer(factory)
> default_vg = getattr(container, "name", None)
>
> + log.debug("default vg is %s" % default_vg)
> vg_combo.remove_all()
> vgs = self.__storage.vgs
> for vg in vgs:
> @@ -2229,9 +2230,15 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
> if default_vg and vg.name == default_vg:
> vg_combo.set_active(vgs.index(vg))
>
> + if default_vg is None:
> + hostname = self.data.network.hostname
> + default_vg = self.__storage.suggestContainerName(hostname=hostname)
> + vg_combo.append_text(default_vg)
> + vg_combo.set_active(len(vg_combo.get_model()) - 1)
> +
> vg_combo.append_text(new_vg_text)
> if default_vg is None:
> - vg_combo.set_active(len(vg_combo.get_model()))
> + vg_combo.set_active(len(vg_combo.get_model()) - 1)
>
> vg_combo.show()
> vg_button.show()
> --
> 1.7.7.6
Does this depend on some other patches? On master custom.py doesn't have
default_vg code in it. And it ends at line 2079...
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/anaconda-patches/attachments/20121129/6b3903a3/attachment.sig>
More information about the anaconda-patches
mailing list