[PATCH - rhel6-branch master] Take the request's format into account when deciding to resize (#578471).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If the request has a format, check if the format is resizable before offering
a resize option in the UI.  This prevents us from offering to resize PVs,
which anaconda does not support.

There's a related problem this does not fix:  If you choose to reformat a PV
as a regular filesystem, the option to resize does not appear.
---
 storage/devices.py          |    3 ++-
 storage/formats/__init__.py |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index 6fe7d90..77266c7 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -567,7 +567,8 @@ class StorageDevice(Device):
     @property
     def resizable(self):
         """ Can this type of device be resized? """
-        return self._resizable and self.exists
+        return self._resizable and self.exists and \
+               ((self.format and self.format.resizable) or not self.format)
 
     def notifyKernel(self):
         """ Send a 'change' uevent to the kernel for this device. """
diff --git a/storage/formats/__init__.py b/storage/formats/__init__.py
index adf5ef1..2decf4c 100644
--- a/storage/formats/__init__.py
+++ b/storage/formats/__init__.py
@@ -343,7 +343,7 @@ class DeviceFormat(object):
     @property
     def resizable(self):
         """ Can formats of this type be resized? """
-        return self._resizable
+        return self._resizable and self.exists
 
     @property
     def bootable(self):
-- 
1.6.5.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux