[f22-branch 1/1] Set the default fs label when reformatting (#1141981)

bcl installerbot-noreply at redhat.com
Tue Mar 10 22:04:58 UTC 2015


From: "Brian C. Lane" <bcl at redhat.com>

If the new format has a defauly label, and a label hasn't been set by
the user, use the default. This allows the ESP to be reformatted and
used without removing it and recreating it.
---
 pyanaconda/ui/gui/spokes/custom.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index a278842..b920460 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -980,8 +980,17 @@ def _save_right_side(self, selector):
         label = self._labelEntry.get_text()
         old_label = getattr(device.format, "label", "")
         changed_label = (label != old_label)
+
+        # When reformatting w/o a label set, set it to the default, if there is one
+        if reformat and not changed_label and not label:
+            if hasattr(new_fs, "label") and new_fs.label:
+                label = new_fs.label
+                self._labelEntry.set_text(label)
+                changed_label = True
+
         old_device_info["label"] = old_label
         new_device_info["label"] = label
+
         if changed_label or changed_fs_type:
             error = validate_label(label, new_fs)
             if error:


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/7cce0b98ebbdd4acae78526d42b2dbb01d2f8d6a


More information about the anaconda-patches mailing list