Change in vdsm[ovirt-3.2]: Removing vdsm configuration when removing vdsm service

fsimonce at redhat.com fsimonce at redhat.com
Thu Apr 11 14:13:24 UTC 2013


Hello Douglas Schilling Landgraf, Yaniv Bronhaim, Dan Kenigsberg,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/13812

to review the following change.

Change subject: Removing vdsm configuration when removing vdsm service
......................................................................

Removing vdsm configuration when removing vdsm service

Before we removed that section only over rhel and we looked for the
wrong string. This patch adds sed command for both dist with the current
string that is written by vdsmd init script.

Change-Id: Ia8f59375e20efa6b5de8483a12a772f5f0ce3749
Bug-Id: https://bugzilla.redhat.com/show_bug.cgi?id=902346
Signed-off-by: Yaniv Bronhaim <ybronhei at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/11295
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
Reviewed-by: Douglas Schilling Landgraf <dougsland at redhat.com>
---
M vdsm.spec.in
1 file changed, 14 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/12/13812/1

diff --git a/vdsm.spec.in b/vdsm.spec.in
index 4bc4c6e..f8a2924 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -529,17 +529,25 @@
 %endif
 
 %preun
+if [ "$1" -eq 0 ]; then
+        start_conf_section="## beginning of configuration section by vdsm"
+        end_conf_section="## end of configuration section by vdsm"
+        by_vdsm="by vdsm"
+
+        /bin/sed -i -e "/${start_conf_section}/,/${end_conf_section}/d" \
+                    -e "/${by_vdsm}/d" \
+               %{_sysconfdir}/libvirt/libvirtd.conf \
+               %{_sysconfdir}/libvirt/qemu.conf \
+               %{_sysconfdir}/sysconfig/libvirtd \
+               %{_sysconfdir}/sysctl.conf \
+               %{_sysconfdir}/libvirt/qemu-sanlock.conf
+fi
+
 %if 0%{?rhel}
 if [ "$1" -eq 0 ]
 then
     /sbin/service vdsmd stop > /dev/null 2>&1 || :
     /sbin/chkconfig --del vdsmd
-
-    /bin/sed -i '/# by vdsm$/d' \
-        /etc/libvirt/libvirtd.conf \
-        /etc/libvirt/qemu.conf \
-        /etc/sysconfig/libvirtd \
-        /etc/sysctl.conf
 
     /bin/sed -i '/# VDSM section begin/,/# VDSM section end/d' \
         /etc/sysctl.conf


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia8f59375e20efa6b5de8483a12a772f5f0ce3749
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.2
Gerrit-Owner: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>


More information about the vdsm-patches mailing list