[node-patches] Change in ovirt-node[master]: config: Fix logrotate migration

fabiand at redhat.com fabiand at redhat.com
Fri May 22 13:13:52 UTC 2015


Fabian Deutsch has uploaded a new change for review.

Change subject: config: Fix logrotate migration
......................................................................

config: Fix logrotate migration

It can happen that no logrotate interval is set, in this case
we should not try to migrate the config.

Change-Id: Ida64eafd93e6c678f8f718f494f396830661b7aa
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1223717
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M src/ovirt/node/config/migrate.py
M src/ovirtnode/ovirtfunctions.py
2 files changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/47/41347/1

diff --git a/src/ovirt/node/config/migrate.py b/src/ovirt/node/config/migrate.py
index ed9345b..ee16f61 100644
--- a/src/ovirt/node/config/migrate.py
+++ b/src/ovirt/node/config/migrate.py
@@ -120,7 +120,7 @@
     def translate_logrotate(self):
         if self.__is_persisted("/etc/logrotate.d/ovirt-node"):
             logrotate_size = ovirtfunctions.get_logrotate_size()
-            if logrotate_size is not 1024:
+            if logrotate_size and logrotate_size is not 1024:
                 self.aug.set(
                     "/files/etc/default/ovirt/OVIRT_LOGROTATE_MAX_SIZE",
                     str(logrotate_size) or "")
diff --git a/src/ovirtnode/ovirtfunctions.py b/src/ovirtnode/ovirtfunctions.py
index 0dd714c..c881d07 100644
--- a/src/ovirtnode/ovirtfunctions.py
+++ b/src/ovirtnode/ovirtfunctions.py
@@ -1600,6 +1600,8 @@
 
 def get_logrotate_size():
     size = augtool_get("/files/etc/logrotate.d/ovirt-node/rule/size")
+    if not size:
+        return None
     if "m" in size.lower():
         multiplier = 1024
     else:


-- 
To view, visit https://gerrit.ovirt.org/41347
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ida64eafd93e6c678f8f718f494f396830661b7aa
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at redhat.com>



More information about the node-patches mailing list