Hello mooli tayer, Dan Kenigsberg,

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

    http://gerrit.ovirt.org/33858

to review the following change.

Change subject: Signs vdsm upgraded version for special treatment if required
......................................................................

Signs vdsm upgraded version for special treatment if required

In ovirt-3.2 (vdsm 4.10.x) we didn't perform vdsm-tool configure call
during uninstall. This cause failure on first vdsm run if configure is
required. This patch signs during pre installation the upgraded
package version by creating a file with the version string.
During init script we read this file and determine the required
operation. This patch only adds the treatment for 4.10.x which will
perform vdsm-configure call. After handling the upgrade we will remove
the file to avoid running the same operation on next reset.

Change-Id: I412dc9992675acbb9d03dfa645468789cfb6e65e
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1111935
Signed-off-by: Yaniv Bronhaim <[email protected]>
Reviewed-on: http://gerrit.ovirt.org/31561
Reviewed-by: mooli tayer <[email protected]>
Reviewed-by: Dan Kenigsberg <[email protected]>
---
M init/vdsmd_init_common.sh.in
M vdsm.spec.in
2 files changed, 21 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/58/33858/1

diff --git a/init/vdsmd_init_common.sh.in b/init/vdsmd_init_common.sh.in
index 298b658..f23fc14 100644
--- a/init/vdsmd_init_common.sh.in
+++ b/init/vdsmd_init_common.sh.in
@@ -197,6 +197,20 @@
 task_upgrade_300_nets(){
     "$VDSM_TOOL" ${UPGRADE_LOGGING_PARAMS} upgrade-3.0.0-networks
 }
+
+task_upgraded_version_check(){
+    local upgraded_ver_file="@VDSMLIBDIR@/upgraded_version"
+    if [ -f "${upgraded_ver_file}" ]; then
+        local ret=0
+        if grep -q '^vdsm-4\.10\.' "${upgraded_ver_file}"; then
+             # We need to treat the upgrade from 4.10.x specifically
+             # by running manual configure command
+             "$VDSM_TOOL" configure --force
+             ret=$?
+        fi
+        [ "${ret}" -eq 0 ] && rm -f "${upgraded_ver_file}"
+    fi
+}
 #### pre-start tasks end ####
 
 
@@ -233,6 +247,7 @@
             configure_coredump \
             configure_vdsm_logs \
             run_init_hooks \
+            upgraded_version_check \
             check_is_configured \
             validate_configuration \
             prepare_transient_repository \
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 4f822e4..c6de4ac 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -739,6 +739,12 @@
 /usr/sbin/usermod -a -G %{qemu_group},%{snlk_group} %{vdsm_user}
 /usr/sbin/usermod -a -G %{cdrom_group} %{qemu_user}
 
+# We keep the previous rpm version number in a file for managing upgrade flow
+# in vdsmd_init_script upgraded_version_check task
+if [ "$1" -gt 1 ]; then
+    rpm -q %{vdsm_name} > "%{_localstatedir}/lib/%{vdsm_name}/upgraded_version"
+fi
+
 %post
 %{_bindir}/vdsm-tool configure --module sanlock --force >/dev/null
 %{_bindir}/vdsm-tool sebool-config || :


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I412dc9992675acbb9d03dfa645468789cfb6e65e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: mooli tayer <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to