MT#15803 Check oustanding pull actions only (ignore outstanding push actions)

Switch code to new common check function execute_check_shared_storage()

Change-Id: I7ba86912d7b5874f9ce0778a2a87b2afb33be5ee
changes/26/3026/5
Alexander Lutay 11 years ago
parent cad0d3c1b7
commit 550067a6a8

@ -183,11 +183,11 @@ Display usage information and exit.
**--no-action-failure**::
The _check_ and _apply_ actions check for any possibly outstanding push/pull
The _check_ and _apply_ actions check for any possibly outstanding pull
actions on the shared storage. If any outstanding actions are identified then
the script aborts to avoid running into tricky configuration merge situations.
If this option is enabled then ngcpcfg instead doesn't abort on outstanding
push/pull actions. This option should be used with care and only if you know
pull actions. This option should be used with care and only if you know
what you're doing.
Note: This option is available in the High Availability setup only.
@ -212,7 +212,7 @@ the most commonly executed commands.
**check** [<config_files_or_directories>|<pattern>]::
Check syntax of YAML files and validate schema before performing any further actions.
In the High Availability setup possibly outstanding push/pull actions are
In the High Availability setup possibly outstanding pull actions are
checked as well.
**build** [--modified-only] [<files_or_directories>|<pattern>]::

@ -97,29 +97,29 @@ check_configs_conflicts() {
}
check_shared_storage() {
# ensure there are no outstanding pull/push actions,
# ensure there are no outstanding pull actions,
# unless --no-action-failure is used (ignore then)
if ! type -p execute_check_shared_storage &>/dev/null ; then
log_debug "execute_check_shared_storage not available"
return 0
fi
log_debug "execute_check_shared_storage function"
log_debug "execute_check_shared_storage function, action pull"
if [ "${NO_ACTION_FAILURE:-}" = "1" ] ; then
if execute_check_shared_storage ; then
log_debug "No outstanding actions identified (NO_ACTION_FAILURE=1)."
if execute_check_shared_storage pull ; then
log_debug "No outstanding pull actions identified (NO_ACTION_FAILURE=1)."
else
log_info "Ignoring outstanding push/pull actions as --no-action-failure option is enabled."
log_info "Ignoring outstanding pull actions as --no-action-failure option is enabled."
fi
return 0
fi
execute_check_shared_storage && RC=0 || RC=$?
execute_check_shared_storage pull && RC=0 || RC=$?
if [ "$RC" = "0" ] ; then
log_debug "No outstanding actions identified (NO_ACTION_FAILURE unset)."
log_debug "No outstanding pull actions identified (NO_ACTION_FAILURE unset)."
else
log_info "Outstanding push/pull actions have been identified (see ACTION_NEEDED), exiting."
log_info "Outstanding pull actions have been identified (see ACTION_NEEDED), exiting."
log_info "TIP: '--no-action-failure' forces execution within 'apply' anyway (use with care!)."
return $RC
fi

@ -96,16 +96,16 @@ check_etc_state() {
}
check_push() {
if type -p execute_check_push &>/dev/null ; then
log_debug "execute_check_push function"
execute_check_push
if type -p execute_check_shared_storage &>/dev/null ; then
log_debug "execute_check_shared_storage function, action 'push'"
execute_check_shared_storage push
fi
}
check_shared_storage() {
if type -p execute_check_shared_storage &>/dev/null ; then
log_debug "execute_check_shared_storage function"
execute_check_shared_storage
log_debug "execute_check_shared_storage function, action all"
execute_check_shared_storage all
fi
}

Loading…
Cancel
Save