[node-patches] Change in ovirt-node[master]: Stop if the drive size is too small

rbarry at redhat.com rbarry at redhat.com
Wed Apr 16 16:36:36 UTC 2014


Ryan Barry has uploaded a new change for review.

Change subject: Stop if the drive size is too small
......................................................................

Stop if the drive size is too small

If there's not enough space on the selected storage volumes to
install, show a notice on the storage volume page and don't give
the option to continue

Change-Id: I70277cfebbed9646022d2055c9302dbf8fccdf4d
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1087341
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/installer/core/storage_vol_page.py
1 file changed, 19 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/62/26862/1

diff --git a/src/ovirt/node/installer/core/storage_vol_page.py b/src/ovirt/node/installer/core/storage_vol_page.py
index e67af34..513af89 100644
--- a/src/ovirt/node/installer/core/storage_vol_page.py
+++ b/src/ovirt/node/installer/core/storage_vol_page.py
@@ -32,6 +32,14 @@
     _free_space = 0
     _fill = True
 
+    def __init__(self, app):
+        super(Plugin, self).__init__(app)
+
+        # Check our sizes first so we know whether there's enough space
+        self._model = self.__get_default_sizes()
+        self._model["storage.data_size"] = "%s" % self.__calculate_free_space()
+        self.logger.debug("Predefined sizes: %s" % self._model)
+
     def name(self):
         return _("Storage Sizes")
 
@@ -39,11 +47,6 @@
         return 40
 
     def model(self):
-        if not self._model:
-            self._model = self.__get_default_sizes()
-            self._model["storage.data_size"] = "%s" %\
-                                               self.__calculate_free_space()
-            self.logger.debug("Predefined sizes: %s" % self._model)
         return self._model
 
     def validators(self):
@@ -65,6 +68,12 @@
     def ui_content(self):
         ws = [ui.Header("header[0]", _("Storage Volumes")),
               ui.KeywordLabel("storage.drive_size", "Drive size: ")]
+
+        if self._drive_size < 1295:
+            ws.extend([ui.Notice("space.notice",
+                                 "Not enough space! Needs at least "
+                                 "1295MB for installation, %sMB "
+                                 "available" % self._drive_size)])
 
         if not self._fill:
             ws.extend([ui.KeywordLabel("storage.free_space",
@@ -94,8 +103,11 @@
         self.widgets.add(ws)
         page = ui.Page("storage", ws)
         page.buttons = [ui.QuitButton("button.quit", _("Quit")),
-                        ui.Button("button.back", _("Back")),
-                        ui.SaveButton("button.next", _("Continue"))]
+                        ui.Button("button.back", _("Back"))]
+
+        if not self._drive_size < 1295:
+            page.buttons.extend([ui.SaveButton("button.next", _("Continue"))])
+
         return page
 
     def on_change(self, changes):


-- 
To view, visit http://gerrit.ovirt.org/26862
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I70277cfebbed9646022d2055c9302dbf8fccdf4d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list