[node-patches] Change in ovirt-node[master]: [RFE] show available space for data instead of -1

rbarry at redhat.com rbarry at redhat.com
Mon Jun 24 23:22:29 UTC 2013


Ryan Barry has uploaded a new change for review.

Change subject: [RFE] show available space for data instead of -1
......................................................................

[RFE] show available space for data instead of -1

Try to calculate available disk space and display it

Change-Id: I3854b4d3469d2e0f2033e99d548f0e16c3f040a6
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirtnode/storage.py
1 file changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/51/16051/1

diff --git a/src/ovirtnode/storage.py b/src/ovirtnode/storage.py
index 5fb0399..4847dd6 100644
--- a/src/ovirtnode/storage.py
+++ b/src/ovirtnode/storage.py
@@ -49,8 +49,6 @@
         self.HOSTVGDRIVE = ""
         self.APPVGDRIVE = []
         self.ISCSIDRIVE = ""
-        # -1 indicates data partition should use remaining disk
-        self.DATA_SIZE = -1
         # gpt or msdos partition table type
         self.LABEL_TYPE = "gpt"
         if "OVIRT_INIT" in OVIRT_VARS:
@@ -98,6 +96,14 @@
         else:
             self.SWAP_SIZE = _functions.calculate_swap_size( \
                                  float(self.overcommit))
+        self.DATA_SIZE = -1
+
+        self.check_partition_sizes()
+        self.DATA_SIZE = self.drive_disk_size - sum(int(vars(self)[x]) for x in
+                                                vars(self) if re.match(
+                                                "[^BOOT)][A-Z]+_SIZE", x) and
+                                                vars(self)[x] > 0)
+
         for i in ['OVIRT_VOL_BOOT_SIZE', 'OVIRT_VOL_ROOT_SIZE',
                   'OVIRT_VOL_CONFIG_SIZE', 'OVIRT_VOL_LOGGING_SIZE',
                   'OVIRT_VOL_DATA_SIZE', 'OVIRT_VOL_SWAP2_SIZE',


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3854b4d3469d2e0f2033e99d548f0e16c3f040a6
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