[node-patches] Change in ovirt-node[master]: logrotate: Fix configuration file
fabiand at fedoraproject.org
fabiand at fedoraproject.org
Fri Jun 28 10:49:48 UTC 2013
Fabian Deutsch has uploaded a new change for review.
Change subject: logrotate: Fix configuration file
......................................................................
logrotate: Fix configuration file
Previously the ovirt-node configuration file for logrotate had an
invalid syntax, this prevented augeas from beeing able to edit it.
Now the syntax of the file is fixed. Additionally some code has been
migrated to the new codebase.
Change-Id: I1541695ce7199f260b76d8dd9d570888ac09a45f
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=979296
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M logrotate/ovirt-logrotate.conf
M src/ovirt/node/config/defaults.py
M src/ovirtnode/log.py
3 files changed, 6 insertions(+), 13 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/23/16223/1
diff --git a/logrotate/ovirt-logrotate.conf b/logrotate/ovirt-logrotate.conf
index 7c69421..9d6ec9f 100644
--- a/logrotate/ovirt-logrotate.conf
+++ b/logrotate/ovirt-logrotate.conf
@@ -1,4 +1,4 @@
-/var/log/ovirt*.log{
+/var/log/ovirt*.log {
rotate 3
compress
missingok
diff --git a/src/ovirt/node/config/defaults.py b/src/ovirt/node/config/defaults.py
index f726b19..8ea4ab8 100644
--- a/src/ovirt/node/config/defaults.py
+++ b/src/ovirt/node/config/defaults.py
@@ -1210,8 +1210,11 @@
title = "Setting logrotate maximum logfile size"
def commit(self):
- import ovirtnode.log as olog
- olog.set_logrotate_size(max_size)
+ from ovirtnode.ovirtfunctions import ovirt_store_config
+ aug = utils.AugeasWrapper()
+ aug.set("/files/etc/logrotate.d/ovirt-node/rule/size",
+ max_size)
+ ovirt_store_config("/etc/logrotate.d/ovirt-node")
tx = utils.Transaction("Configuring logrotate")
tx.append(CreateLogrotateConfig())
diff --git a/src/ovirtnode/log.py b/src/ovirtnode/log.py
index ef8236b..96c1888 100755
--- a/src/ovirtnode/log.py
+++ b/src/ovirtnode/log.py
@@ -114,16 +114,6 @@
return True
-def set_logrotate_size(size):
- try:
- _functions.augtool("set", \
- "/files/etc/logrotate.d/ovirt-node/rule/size", size)
- _functions.ovirt_store_config("/etc/logrotate.d/ovirt-node")
- return True
- except:
- return False
-
-
def get_rsyslog_config():
rsyslog_config = open(RSYSLOG_FILE)
for line in rsyslog_config:
--
To view, visit http://gerrit.ovirt.org/16223
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1541695ce7199f260b76d8dd9d570888ac09a45f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>
More information about the node-patches
mailing list