Alon Bar-Lev has posted comments on this change.
Change subject: fcp: Deactivate vdsm logical volumes ......................................................................
Patch Set 16:
(1 comment)
.................................................... File init/vdsmd_init_common.sh.in Line 180: } Line 181: Line 182: task_lvm_deactivate_lvs(){ Line 183: "$VDSM_TOOL" lvm-deactivate-lvs Line 184: } We do not require to perform unit test to lvm program... this logic is not to be changed unless lvm is changed.
Sorry... had misunderstanding of the python logic... a fix:
task_lvm_deactivate_lvs() { local guard="@VDSMRUNDIR@/vdsm-lvm" [ -f "${guard}" ] || return 0 touch "${guard}"
local line lvm vgs --noheading --separator '|' -o name,tags | while IFS='|' read vg tags; do vdsmFCVG() { local tags="$1" echo "${tags}" | grep -q "RHAT_storage_domain" && echo "${tags}" | grep -q "MDT_TYPE=FCP" }
vg=$(echo ${vg}) # strip if vdsmFCVG "${tags}"; then if ! lvm vgchange --available n "${vg}"; then lvm lvs --noheading --separator '|' -o name,attr "${vg}" | while IFS='|' read lv attr; do lv=$(echo ${lv}) # strip case "${attr}" in ????-*);; ????ao*) echo "Skiping ${vg}/${lv} active or open" ;; *) lvm lvchange --available n "${vg}/${lv}" || exit 1 ;; esac done || exit 1 fi fi done if [ $? != 0 ]; then echo "Failed to diactivate lvs" return 1 fi
return 0 } Line 185: #### pre-start tasks end #### Line 186: Line 187: Line 188: #### post-stop tasks ####