[PATCH] Add a basic method for checking the minimal size needed for a backend

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

 



Add a basic way to query a backend for how much space is needed on a
per-partition basis.  This isn't always able to be known and if it's
unknown, then you'll get back 0.  Add the implementation for / on
livecd
---
 backend.py |    4 ++++
 livecd.py  |    5 +++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/backend.py b/backend.py
index ad0285e..3008671 100644
--- a/backend.py
+++ b/backend.py
@@ -188,6 +188,10 @@ class AnacondaBackend:
     def kernelVersionList(self, rootPath="/"):
         return []
 
+    def getMinimumSizeMB(self, part):
+        """Return the minimal size for part in megabytes if we can."""
+        return 0
+
     def doBackendSetup(self, anaconda):
         log.warning("doBackendSetup not implemented for backend!")
         raise NotImplementedError
diff --git a/livecd.py b/livecd.py
index f3afc20..5d7d3f7 100644
--- a/livecd.py
+++ b/livecd.py
@@ -366,6 +366,11 @@ class LiveCDCopyBackend(backend.AnacondaBackend):
     def kernelVersionList(self, rootPath = "/"):
         return packages.rpmKernelVersionList(rootPath)
 
+    def getMinimumSizeMB(self, part):
+        if part == "/":
+            return self._getLiveSizeMB()
+        return 0
+
     def doBackendSetup(self, anaconda):
         # ensure there's enough space on the rootfs
         # FIXME: really, this should be in the general sanity checking, but
-- 
1.6.0.3

_______________________________________________
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