Adapting the test for the changed behavior of lvconvert
where the mirror leg and log count is not changing.
Properly test for this condition - checking only leg count is
not enough to expect error return code.
And finaly fixing invalid bash scripting logic since:
test && TRUE || FALSE
is not bash equivalent of:
if test ; then
TRUE
else
FALSE
fi
if [ "$finish_count" -eq 0 ]; then
mirrorlog=""
finish_log_type=""
+ finish_log_count=$start_log_count
else
mirrorlog="--mirrorlog"
fi
- [ $start_count -eq $finish_count ] && \
- not lvconvert --type mirror -m $finish_count $mirrorlog $finish_log_type $vg/$lv1 $alloc || \
+ if [ $start_count -eq $finish_count ] && [ $start_log_count -eq $finish_log_count ]; then
+ not lvconvert --type mirror -m $finish_count $mirrorlog $finish_log_type $vg/$lv1 $alloc
+ else
lvconvert --type mirror -m $finish_count $mirrorlog $finish_log_type $vg/$lv1 $alloc
+ fi
test "$active" = "-an" || lvchange "$active" $vg/$lv1