[node-patches] Change in ovirt-node[master]: Show free space in the confirmation page
rbarry at redhat.com
rbarry at redhat.com
Wed Oct 22 14:45:51 UTC 2014
Ryan Barry has uploaded a new change for review.
Change subject: Show free space in the confirmation page
......................................................................
Show free space in the confirmation page
Update the model in the storage volumes page instead of just the
widget text, so it gets pulled in correctly.
Also, tweak the confirmation page a little bit so all the sizes
consistently say "MB" at the end.
Change-Id: Ia472f21b86002de799609bc9a907e3760c3855ee
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1153472
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/installer/core/confirmation_page.py
M src/ovirt/node/installer/core/storage_vol_page.py
2 files changed, 9 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/71/34371/1
diff --git a/src/ovirt/node/installer/core/confirmation_page.py b/src/ovirt/node/installer/core/confirmation_page.py
index 09109d5..85025e4 100644
--- a/src/ovirt/node/installer/core/confirmation_page.py
+++ b/src/ovirt/node/installer/core/confirmation_page.py
@@ -25,6 +25,7 @@
from ovirt.node import plugins, ui
from ovirt.node.installer.core.boot_device_page import StorageDiscovery
from ovirt.node.utils.system import LVM
+import re
class Plugin(plugins.NodePlugin):
@@ -78,7 +79,7 @@
"domain!"))])
ws.extend([ui.Divider("divider[0]"),
- ui.KeywordLabel("storage.volumes", _("Volume sizes (MB)"))])
+ ui.KeywordLabel("storage.volumes", _("Volume sizes"))])
intuples = lambda lst, n: [lst[x:x+n] for x in range(0, len(lst), n)]
for xs in intuples(sorted(k for k in self._model.keys()
@@ -116,11 +117,16 @@
self.application.plugins().values() if not
plugin.name() == "Confirm disk selections"]
+ [_model.update({k: "%s MB" % _model[k]}) for k in _model.keys() if
+ re.match(r'storage.*?size$', k) and not _model[k].endswith(" MB")]
+
+
if "storage.fill_data" in _model:
del _model["storage.fill_data"]
_model["installation.devices"].sort()
self._model = _model
+ self.logger.debug("SET %s" % _model)
def _storage_tagged(self, dev):
found = False
diff --git a/src/ovirt/node/installer/core/storage_vol_page.py b/src/ovirt/node/installer/core/storage_vol_page.py
index e7b8b32..608cd92 100644
--- a/src/ovirt/node/installer/core/storage_vol_page.py
+++ b/src/ovirt/node/installer/core/storage_vol_page.py
@@ -129,6 +129,8 @@
size_keys.append("storage.data_size")
if changes.contains_any(size_keys):
self._free_space = self.__calculate_free_space()
+ self._model["storage.free_space"] = "%s MB" % self._free_space
+
if "storage.free_space" in self.widgets:
self.widgets["storage.free_space"].text("%s MB" %
self._free_space)
--
To view, visit http://gerrit.ovirt.org/34371
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia472f21b86002de799609bc9a907e3760c3855ee
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