[node-patches] Change in ovirt-node[master]: handle log_size set to 0
mburns at redhat.com
mburns at redhat.com
Fri Oct 19 13:09:02 UTC 2012
Michael Burns has uploaded a new change for review.
Change subject: handle log_size set to 0
......................................................................
handle log_size set to 0
A couple changes went into this:
1. Set MIN_LOG_SIZE in storage.py = 5MB
2. compare value set by user on TUI to MIN_LOG_SIZE
3. Don't force 2048 for LOG_SIZE, though keep it as the default
rhbz#868215
Change-Id: Ie0fb03b2a55d8dedb2181267ee4380aa5fdc391c
Signed-off-by: Mike Burns <mburns at redhat.com>
---
M scripts/ovirt-config-installer.py
M scripts/ovirtnode/storage.py
2 files changed, 12 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/76/8676/1
diff --git a/scripts/ovirt-config-installer.py b/scripts/ovirt-config-installer.py
index 83bc948..17bc2d7 100644
--- a/scripts/ovirt-config-installer.py
+++ b/scripts/ovirt-config-installer.py
@@ -249,9 +249,13 @@
return
def log_size_callback(self):
+ Storage = storage.Storage()
if not check_int(self.LOGGING_SIZE.value()):
self.log_vol_failed = True
self.log_vol_msg = "Logging Partition Size must be a positive integer."
+ elif int(self.LOGGING_SIZE.value()) < int(Storage.MIN_LOGGING_SIZE):
+ self.log_vol_failed = True
+ self.log_vol_msg = "Minimum Config size is %s MB." % Storage.MIN_LOGGING_SIZE
else:
self.log_vol_failed = False
self.log_vol_msg = None
diff --git a/scripts/ovirtnode/storage.py b/scripts/ovirtnode/storage.py
index b83514c..2492c9e 100644
--- a/scripts/ovirtnode/storage.py
+++ b/scripts/ovirtnode/storage.py
@@ -42,6 +42,7 @@
self.EFI_SIZE = 256
self.SWAP_SIZE = 0
self.MIN_SWAP_SIZE = 5
+ self.MIN_LOGGING_SIZE = 5
self.SWAP2_SIZE = 0
self.DATA2_SIZE = 0
self.BOOTDRIVE = ""
@@ -98,13 +99,15 @@
'OVIRT_VOL_CONFIG_SIZE', 'OVIRT_VOL_LOGGING_SIZE',
'OVIRT_VOL_DATA_SIZE', 'OVIRT_VOL_SWAP2_SIZE',
'OVIRT_VOL_DATA2_SIZE', 'OVIRT_VOL_EFI_SIZE']:
- i_short = i.replace("OVIRT_VOL_", "")
+ i_short = i.replace("OVIRT_VOL_", "MIN_")
+ if not i_short in self.__dict__:
+ i_short = i_short.replace("MIN_", "")
if i in OVIRT_VARS:
if int(OVIRT_VARS[i]) < int(self.__dict__[i_short]):
- logger.error("%s is smaller than minimum required size " +
- "of: %s" % (i, self.__dict__[i_short]))
- print ("\n%s is smaller than minimum required size of: " +
- "%s" % (i, self.__dict__[i_short]))
+ logger.error(("%s is smaller than minimum required size " +
+ "of: %s") % (i, self.__dict__[i_short]))
+ print (("\n%s is smaller than minimum required size of: " +
+ "%s") % (i, self.__dict__[i_short]))
return False
logging.info(("Setting value for %s to %s " %
(self.__dict__[i_short], _functions.OVIRT_VARS[i])))
--
To view, visit http://gerrit.ovirt.org/8676
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie0fb03b2a55d8dedb2181267ee4380aa5fdc391c
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Michael Burns <mburns at redhat.com>
More information about the node-patches
mailing list