Rebuilt targets

This commit is contained in:
deajan 2019-05-20 22:19:27 +02:00
parent 5638565f6a
commit aca0be5a9b
2 changed files with 20 additions and 30 deletions

View File

@ -6,8 +6,8 @@
PROGRAM="osync" # Rsync based two way sync engine with fault tolerance PROGRAM="osync" # Rsync based two way sync engine with fault tolerance
AUTHOR="(C) 2013-2019 by Orsiris de Jong" AUTHOR="(C) 2013-2019 by Orsiris de Jong"
CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr"
PROGRAM_VERSION=1.3.0-pre-rc1 PROGRAM_VERSION=1.3.0-beta2
PROGRAM_BUILD=2019052011 PROGRAM_BUILD=2019052013
IS_STABLE=false IS_STABLE=false
CONFIG_FILE_REVISION_REQUIRED=1.3.0 CONFIG_FILE_REVISION_REQUIRED=1.3.0
@ -2519,7 +2519,6 @@ function CheckCurrentConfig {
# v2 config will use true / false instead of yes / no # v2 config will use true / false instead of yes / no
# Check all variables that should contain "yes" or "no", true or false # Check all variables that should contain "yes" or "no", true or false
for i in "${booleans[@]}"; do for i in "${booleans[@]}"; do
#test="if [ \"\$$i\" != \"yes\" ] && [ \"\$$i\" != \"no\" ] && [ \"\$$i\" != true ] && [ \"\$$i\" != false ]; then Logger \"Bogus $i value [\$$i] defined in config file. Correct your config file or update it using the update script if using and old version.\" \"CRITICAL\"; exit 1; fi"
test="if [ \"\$$i\" != true ] && [ \"\$$i\" != false ]; then Logger \"Bogus $i value [\$$i] defined in config file. Correct your config file or update it using the update script if using and old version.\" \"CRITICAL\"; exit 1; fi" test="if [ \"\$$i\" != true ] && [ \"\$$i\" != false ]; then Logger \"Bogus $i value [\$$i] defined in config file. Correct your config file or update it using the update script if using and old version.\" \"CRITICAL\"; exit 1; fi"
eval "$test" eval "$test"
# Fix for upcomming v2 where yes and no do not exist anymore # Fix for upcomming v2 where yes and no do not exist anymore
@ -3344,24 +3343,20 @@ function HandleLocks {
targetLockSuccess=false targetLockSuccess=false
fi fi
done done
#WIP refactor the following
if [ $initiatorLockSuccess == true ]; then
INITIATOR_LOCK_FILE_EXISTS=true
fi
if [ $targetLockSuccess == true ]; then
TARGET_LOCK_FILE_EXISTS=true
fi
Logger "Cancelling task." "CRITICAL" $retval
exit 1
fi fi
if [ $initiatorLockSuccess == true ]; then if [ $initiatorLockSuccess == true ]; then
INITIATOR_LOCK_FILE_EXISTS=true INITIATOR_LOCK_FILE_EXISTS=true
fi fi
if [ $targetLockSuccess == true ]; then if [ $targetLockSuccess == true ]; then
TARGET_LOCK_FILE_EXISTS=true TARGET_LOCK_FILE_EXISTS=true
fi fi
if [ $retval -ne 0 ]; then
Logger "Cancelling task." "CRITICAL" $retval
exit 1
fi
} }
function _UnlockReplicasLocal { function _UnlockReplicasLocal {
@ -4865,7 +4860,7 @@ function Sync {
## Step 2a & 2b ## Step 2a & 2b
if [ "$resumeInitiator" == "${SYNC_ACTION[2]}" ] || [ "$resumeTarget" == "${SYNC_ACTION[2]}" ]; then if [ "$resumeInitiator" == "${SYNC_ACTION[2]}" ] || [ "$resumeTarget" == "${SYNC_ACTION[2]}" ]; then
#if [[ "$RSYNC_ATTR_ARGS" == *"-X"* ]] || [[ "$RSYNC_ATTR_ARGS" == *"-A"* ]] || [ "$LOG_CONFLICTS" == true ]; then #if [[ "$RSYNC_ATTR_ARGS" == *"-X"* ]] || [[ "$RSYNC_ATTR_ARGS" == *"-A"* ]] || [ "$LOG_CONFLICTS" == true ]; then
#TODO: refactor in v1.3 with syncattrs #TODO: refactor in v1.4 with syncattrs
if [ "$LOG_CONFLICTS" == true ]; then if [ "$LOG_CONFLICTS" == true ]; then
if [ "$resumeInitiator" == "${SYNC_ACTION[2]}" ]; then if [ "$resumeInitiator" == "${SYNC_ACTION[2]}" ]; then
@ -5121,7 +5116,7 @@ function Sync {
# Step 8a & 8b # Step 8a & 8b
if [ "$resumeInitiator" == "${SYNC_ACTION[8]}" ] || [ "$resumeTarget" == "${SYNC_ACTION[8]}" ]; then if [ "$resumeInitiator" == "${SYNC_ACTION[8]}" ] || [ "$resumeTarget" == "${SYNC_ACTION[8]}" ]; then
#if [[ "$RSYNC_ATTR_ARGS" == *"-X"* ]] || [[ "$RSYNC_ATTR_ARGS" == *"-A"* ]] || [ "$LOG_CONFLICTS" == true ]; then #if [[ "$RSYNC_ATTR_ARGS" == *"-X"* ]] || [[ "$RSYNC_ATTR_ARGS" == *"-A"* ]] || [ "$LOG_CONFLICTS" == true ]; then
#TODO: refactor in v1.3 with syncattrs #TODO: refactor in v1.4 with syncattrs
if [ "$LOG_CONFLICTS" == true ]; then if [ "$LOG_CONFLICTS" == true ]; then
if [ "$resumeInitiator" == "${SYNC_ACTION[8]}" ]; then if [ "$resumeInitiator" == "${SYNC_ACTION[8]}" ]; then

View File

@ -6,8 +6,8 @@
PROGRAM="osync" # Rsync based two way sync engine with fault tolerance PROGRAM="osync" # Rsync based two way sync engine with fault tolerance
AUTHOR="(C) 2013-2019 by Orsiris de Jong" AUTHOR="(C) 2013-2019 by Orsiris de Jong"
CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr"
PROGRAM_VERSION=1.3.0-pre-rc1 PROGRAM_VERSION=1.3.0-beta2
PROGRAM_BUILD=2019052011 PROGRAM_BUILD=2019052013
IS_STABLE=false IS_STABLE=false
CONFIG_FILE_REVISION_REQUIRED=1.3.0 CONFIG_FILE_REVISION_REQUIRED=1.3.0
@ -2368,7 +2368,6 @@ function CheckCurrentConfig {
# v2 config will use true / false instead of yes / no # v2 config will use true / false instead of yes / no
# Check all variables that should contain "yes" or "no", true or false # Check all variables that should contain "yes" or "no", true or false
for i in "${booleans[@]}"; do for i in "${booleans[@]}"; do
#test="if [ \"\$$i\" != \"yes\" ] && [ \"\$$i\" != \"no\" ] && [ \"\$$i\" != true ] && [ \"\$$i\" != false ]; then Logger \"Bogus $i value [\$$i] defined in config file. Correct your config file or update it using the update script if using and old version.\" \"CRITICAL\"; exit 1; fi"
test="if [ \"\$$i\" != true ] && [ \"\$$i\" != false ]; then Logger \"Bogus $i value [\$$i] defined in config file. Correct your config file or update it using the update script if using and old version.\" \"CRITICAL\"; exit 1; fi" test="if [ \"\$$i\" != true ] && [ \"\$$i\" != false ]; then Logger \"Bogus $i value [\$$i] defined in config file. Correct your config file or update it using the update script if using and old version.\" \"CRITICAL\"; exit 1; fi"
eval "$test" eval "$test"
# Fix for upcomming v2 where yes and no do not exist anymore # Fix for upcomming v2 where yes and no do not exist anymore
@ -3168,24 +3167,20 @@ function HandleLocks {
targetLockSuccess=false targetLockSuccess=false
fi fi
done done
#WIP refactor the following
if [ $initiatorLockSuccess == true ]; then
INITIATOR_LOCK_FILE_EXISTS=true
fi
if [ $targetLockSuccess == true ]; then
TARGET_LOCK_FILE_EXISTS=true
fi
Logger "Cancelling task." "CRITICAL" $retval
exit 1
fi fi
if [ $initiatorLockSuccess == true ]; then if [ $initiatorLockSuccess == true ]; then
INITIATOR_LOCK_FILE_EXISTS=true INITIATOR_LOCK_FILE_EXISTS=true
fi fi
if [ $targetLockSuccess == true ]; then if [ $targetLockSuccess == true ]; then
TARGET_LOCK_FILE_EXISTS=true TARGET_LOCK_FILE_EXISTS=true
fi fi
if [ $retval -ne 0 ]; then
Logger "Cancelling task." "CRITICAL" $retval
exit 1
fi
} }
function _UnlockReplicasLocal { function _UnlockReplicasLocal {
@ -4655,7 +4650,7 @@ function Sync {
## Step 2a & 2b ## Step 2a & 2b
if [ "$resumeInitiator" == "${SYNC_ACTION[2]}" ] || [ "$resumeTarget" == "${SYNC_ACTION[2]}" ]; then if [ "$resumeInitiator" == "${SYNC_ACTION[2]}" ] || [ "$resumeTarget" == "${SYNC_ACTION[2]}" ]; then
#if [[ "$RSYNC_ATTR_ARGS" == *"-X"* ]] || [[ "$RSYNC_ATTR_ARGS" == *"-A"* ]] || [ "$LOG_CONFLICTS" == true ]; then #if [[ "$RSYNC_ATTR_ARGS" == *"-X"* ]] || [[ "$RSYNC_ATTR_ARGS" == *"-A"* ]] || [ "$LOG_CONFLICTS" == true ]; then
#TODO: refactor in v1.3 with syncattrs #TODO: refactor in v1.4 with syncattrs
if [ "$LOG_CONFLICTS" == true ]; then if [ "$LOG_CONFLICTS" == true ]; then
if [ "$resumeInitiator" == "${SYNC_ACTION[2]}" ]; then if [ "$resumeInitiator" == "${SYNC_ACTION[2]}" ]; then
@ -4911,7 +4906,7 @@ function Sync {
# Step 8a & 8b # Step 8a & 8b
if [ "$resumeInitiator" == "${SYNC_ACTION[8]}" ] || [ "$resumeTarget" == "${SYNC_ACTION[8]}" ]; then if [ "$resumeInitiator" == "${SYNC_ACTION[8]}" ] || [ "$resumeTarget" == "${SYNC_ACTION[8]}" ]; then
#if [[ "$RSYNC_ATTR_ARGS" == *"-X"* ]] || [[ "$RSYNC_ATTR_ARGS" == *"-A"* ]] || [ "$LOG_CONFLICTS" == true ]; then #if [[ "$RSYNC_ATTR_ARGS" == *"-X"* ]] || [[ "$RSYNC_ATTR_ARGS" == *"-A"* ]] || [ "$LOG_CONFLICTS" == true ]; then
#TODO: refactor in v1.3 with syncattrs #TODO: refactor in v1.4 with syncattrs
if [ "$LOG_CONFLICTS" == true ]; then if [ "$LOG_CONFLICTS" == true ]; then
if [ "$resumeInitiator" == "${SYNC_ACTION[8]}" ]; then if [ "$resumeInitiator" == "${SYNC_ACTION[8]}" ]; then