Change in vdsm[master]: tool: Remove leftover libvirtd.log rotating logic.
mtayer at redhat.com
mtayer at redhat.com
Wed Oct 8 10:14:59 UTC 2014
mooli tayer has uploaded a new change for review.
Change subject: tool: Remove leftover libvirtd.log rotating logic.
......................................................................
tool: Remove leftover libvirtd.log rotating logic.
Vdsm libvirt logging definitions were recently dropped in
favor of libvirt defaults[1]. It is now up to libvirt to
manage logging, rotating included.
[1] http://gerrit.ovirt.org/#/q/I251c2534d3284aa95bffa56143c449d5de887008,n,z
Change-Id: I08e005c2fdd874941abd5dea7d30b3955cadde20
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1149757
Signed-off-by: Mooli Tayer <mtayer at redhat.com>
---
M debian/vdsm.prerm
M lib/vdsm/tool/Makefile.am
M lib/vdsm/tool/configurators/libvirt.py
D lib/vdsm/tool/libvirtd.logrotate
M tests/Makefile.am
M tests/toolTests.py
D tests/toolTests_libvirt_logrotate.conf
M vdsm.spec.in
M vdsm/Makefile.am
D vdsm/vdsm-libvirt-logrotate
10 files changed, 0 insertions(+), 103 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/25/33925/1
diff --git a/debian/vdsm.prerm b/debian/vdsm.prerm
index 596c5be..dfc54a6 100644
--- a/debian/vdsm.prerm
+++ b/debian/vdsm.prerm
@@ -31,12 +31,9 @@
/etc/default/libvirt-bin \
/etc/libvirt/libvirtd.conf \
/etc/libvirt/qemu.conf \
- /etc/logrotate.d/libvirtd \
/etc/sysctl.conf \
/etc/default/sanlock
- # Restoring backuped logrotate.d/libvirtd
- sed -i -e 's/# VDSM backup//' /etc/logrotate.d/libvirtd
vdsm-tool sebool-unconfig || :
saslpasswd2 -p -a libvirt -d vdsm at ovirt
;;
diff --git a/lib/vdsm/tool/Makefile.am b/lib/vdsm/tool/Makefile.am
index a181617..94059ce 100644
--- a/lib/vdsm/tool/Makefile.am
+++ b/lib/vdsm/tool/Makefile.am
@@ -21,12 +21,6 @@
include $(top_srcdir)/build-aux/Makefile.subs
-toolfilesdir=$(pkgdatadir)/tool
-
-dist_toolfiles_DATA= \
- libvirtd.logrotate \
- $(NULL)
-
EXTRA_DIST = \
load_needed_modules.py.in \
validate_ovirt_certs.py.in \
diff --git a/lib/vdsm/tool/configurators/libvirt.py b/lib/vdsm/tool/configurators/libvirt.py
index 5d15de2..63e5ff6 100644
--- a/lib/vdsm/tool/configurators/libvirt.py
+++ b/lib/vdsm/tool/configurators/libvirt.py
@@ -257,17 +257,6 @@
for key, val in configuration.items():
conff.addEntry(key, val)
- def _prefixAndPrepend(self, content, vdsmConfiguration):
- """
- Prefix each line with a comment and prepend a section
- from file path defined by 'content["prependFile"]'
- """
- with self._openConfig(content['path']) as conf:
- conf.prefixLines()
-
- with open(self._getFile(content['prependFile'])) as src_conf:
- conf.prependSection(src_conf.read())
-
def _removeFile(self, content, vdsmConfiguration):
"""
delete a file if it exists.
@@ -280,15 +269,6 @@
except OSError as e:
if e.errno != errno.ENOENT:
raise
-
- def _unprefixAndRemoveSection(self, path):
- """
- undo changes done by _prefixAndPrepend.
- """
- if os.path.exists(path):
- with self._openConfig(path) as conff:
- conff.removeConf()
- conff.unprefixLines()
def _removeSection(self, path):
"""
@@ -475,29 +455,6 @@
}
]
},
-
- 'LRCONF': {
- 'path': os.path.join(
- constants.SYSCONF_PATH,
- 'logrotate.d/libvirtd',
- ),
- 'configure': _prefixAndPrepend,
- 'prependFile': 'LRCONF_EXAMPLE',
- 'removeConf': _unprefixAndRemoveSection,
- 'persisted': True,
- },
-
- 'LRCONF_EXAMPLE': {
- 'path': os.path.join(
- constants.P_VDSM,
- 'tool',
- 'libvirtd.logrotate',
- ),
- 'configure': lambda x, y, z: True,
- 'removeConf': lambda x, y: True,
- 'persisted': False,
- },
-
'QNETWORK': {
'path': os.path.join(
diff --git a/lib/vdsm/tool/libvirtd.logrotate b/lib/vdsm/tool/libvirtd.logrotate
deleted file mode 100644
index 8d9dfd8..0000000
--- a/lib/vdsm/tool/libvirtd.logrotate
+++ /dev/null
@@ -1,10 +0,0 @@
-/var/log/libvirt/libvirtd.log {
- rotate 100
- missingok
- copytruncate
- size 15M
- compress
- compresscmd /usr/bin/xz
- uncompresscmd /usr/bin/unxz
- compressext .xz
-}
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 449d7b1..39299fb 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -128,7 +128,6 @@
tc_filter_show.out \
toolTests_empty.conf \
toolTests_lconf_ssl.conf \
- toolTests_libvirt_logrotate.conf \
toolTests_libvirtd.conf \
toolTests_qemu_sanlock.conf \
toolTests_qemu_ssl.conf \
diff --git a/tests/toolTests.py b/tests/toolTests.py
index 67d9f6b..998df4b 100644
--- a/tests/toolTests.py
+++ b/tests/toolTests.py
@@ -256,12 +256,7 @@
self.test_env['QCONF'] = self._test_dir + '/qemu.conf'
self.test_env['LDCONF'] = self._test_dir + '/qemu-sanlock.conf'
self.test_env['QLCONF'] = self._test_dir + '/libvirtd'
- self.test_env['LRCONF'] = self._test_dir + '/logrotate-libvirtd'
self.test_env['QNETWORK'] = 'NON_EXISTENT'
- self.test_env['LRCONF_EXAMPLE'] = os.path.join(
- LibvirtModuleConfigureTests.srcPath,
- 'lib/vdsm/tool/libvirtd.logrotate'
- )
for key, val in self.test_env.items():
libvirt.Configurator.FILES[key]['path'] = val
@@ -339,7 +334,6 @@
self._setConfig(
('LCONF', 'lconf_ssl'),
('QCONF', 'qemu_ssl'),
- ('LRCONF', 'libvirt_logrotate')
)
self.assertEqual(
@@ -353,7 +347,6 @@
self._setConfig(
('LCONF', 'lconf_ssl'),
('QCONF', 'empty'),
- ('LRCONF', 'empty'),
)
self.assertEqual(
libvirtConfigure.isconfigured(),
@@ -367,7 +360,6 @@
'LCONF', 'empty'),
('VDSM_CONF', 'vdsm_ssl'),
('QCONF', 'empty'),
- ('LRCONF', 'empty'),
)
self.assertEqual(
@@ -388,7 +380,6 @@
('LCONF', 'empty'),
('VDSM_CONF', 'vdsm_no_ssl'),
('QCONF', 'empty'),
- ('LRCONF', 'empty'),
)
self.assertEquals(
libvirtConfigure.isconfigured(),
diff --git a/tests/toolTests_libvirt_logrotate.conf b/tests/toolTests_libvirt_logrotate.conf
deleted file mode 100644
index 7befe2d..0000000
--- a/tests/toolTests_libvirt_logrotate.conf
+++ /dev/null
@@ -1,21 +0,0 @@
-## beginning of configuration section by vdsm-%(LATEST_CONF_VERSION)s
-/var/log/libvirt/libvirtd.log {
- rotate 100
- missingok
- copytruncate
- size 15M
- compress
- compresscmd /usr/bin/xz
- uncompresscmd /usr/bin/unxz
- compressext .xz
-}
-## end of configuration section by vdsm-%(LATEST_CONF_VERSION)s
-# VDSM backup/var/log/libvirt/libvirtd.log {
-# VDSM backup weekly
-# VDSM backup missingok
-# VDSM backup rotate 4
-# VDSM backup compress
-# VDSM backup delaycompress
-# VDSM backup copytruncate
-# VDSM backup minsize 100k
-# VDSM backup}
diff --git a/vdsm.spec.in b/vdsm.spec.in
index c38d5bb..14d27e2 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -1014,7 +1014,6 @@
%{_datadir}/%{vdsm_name}/virt/vmxml.py*
%{_datadir}/%{vdsm_name}/virt/sampling.py*
%{_datadir}/%{vdsm_name}/virt/utils.py*
-%{_datadir}/%{vdsm_name}/tool
%config(noreplace) %{_sysconfdir}/%{vdsm_name}/vdsm.conf
%config(noreplace) %{_sysconfdir}/%{vdsm_name}/logger.conf
@@ -1033,7 +1032,6 @@
%{_sysconfdir}/dhcp/dhclient.d/sourceRoute.sh
%{_sysconfdir}/sudoers.d/50_vdsm
%{_sysconfdir}/cron.hourly/vdsm-logrotate
-%{_sysconfdir}/cron.d/vdsm-libvirt-logrotate
%if 0%{?fedora} || 0%{?rhel} >= 7
%{_sysconfdir}/libvirt/hooks/qemu
%endif
@@ -1299,7 +1297,6 @@
%{_datadir}/%{vdsm_name}/tests/tc_filter_show.out
%{_datadir}/%{vdsm_name}/tests/toolTests_empty.conf
%{_datadir}/%{vdsm_name}/tests/toolTests_lconf_ssl.conf
-%{_datadir}/%{vdsm_name}/tests/toolTests_libvirt_logrotate.conf
%{_datadir}/%{vdsm_name}/tests/toolTests_libvirtd.conf
%{_datadir}/%{vdsm_name}/tests/toolTests_qemu_sanlock.conf
%{_datadir}/%{vdsm_name}/tests/toolTests_qemu_ssl.conf
diff --git a/vdsm/Makefile.am b/vdsm/Makefile.am
index d40c7d0..f59b38d 100644
--- a/vdsm/Makefile.am
+++ b/vdsm/Makefile.am
@@ -110,7 +110,6 @@
vdsm-gencerts.sh.in \
vdsm-libvirt-access.pkla \
vdsm-libvirt-access.rules \
- vdsm-libvirt-logrotate \
vdsm-logrotate \
vdsm-logrotate.conf.in \
vdsm-modules-load.d.conf \
@@ -210,14 +209,10 @@
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/cron.hourly
$(INSTALL_SCRIPT) $(srcdir)/vdsm-logrotate \
$(DESTDIR)$(sysconfdir)/cron.hourly/vdsm-logrotate
- $(MKDIR_P) $(DESTDIR)$(sysconfdir)/cron.d
- $(INSTALL_DATA) $(srcdir)/vdsm-libvirt-logrotate \
- $(DESTDIR)$(sysconfdir)/cron.d/vdsm-libvirt-logrotate
uninstall-data-logrotate:
$(RM) $(DESTDIR)$(vdsmconfdir)/logrotate/vdsm
$(RM) $(DESTDIR)$(sysconfdir)/cron.hourly/vdsm-logrotate
- $(RM) $(DESTDIR)$(sysconfdir)/cron.d/vdsm-libvirt-logrotate
install-data-mom:
$(MKDIR_P) $(DESTDIR)$(vdsmconfdir)/mom.d
diff --git a/vdsm/vdsm-libvirt-logrotate b/vdsm/vdsm-libvirt-logrotate
deleted file mode 100644
index 5e70cde..0000000
--- a/vdsm/vdsm-libvirt-logrotate
+++ /dev/null
@@ -1,2 +0,0 @@
-10,25,40,55 * * * * root /usr/sbin/logrotate /etc/logrotate.d/libvirtd
-
--
To view, visit http://gerrit.ovirt.org/33925
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I08e005c2fdd874941abd5dea7d30b3955cadde20
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <mtayer at redhat.com>
More information about the vdsm-patches
mailing list