MT#15973 Revert "MT#15973 Report in 'status' action when build/apply run is needed"

This reverts commit db373d3927.

Conflicts:
	etc/ngcp-config/ngcpcfg.cfg

Until we've a working solution for this let's revert
the broken change so we avoid this being a release
stopper.

Change-Id: If03d9b3913de23c698b430d583dc7babfcc4ff04
changes/91/3791/1
Michael Prokop 10 years ago
parent 04e5fee745
commit 0d828d4108

@ -29,9 +29,6 @@ SERVICES_POOL="${SERVICES_POOL_BASE}/etc"
# timestamp format for console output
TIME_FORMAT="+%F %T"
# directory holding files for internal state of ngcpcfg
TIMESTAMP_DIR='/var/lib/ngcpcfg/timestamps/'
# Run-time state directory
RUN_DIR='/var/run'

@ -125,11 +125,6 @@ if ! [ -d "$TEMPLATE_POOL_BASE" ] ; then
exit 1
fi
if [ -z "${TIMESTAMP_DIR:-}" ] ; then
log_error "No timestamp directory setting [TIMESTAMP_DIR] found - exiting."
exit 1
fi
if [ -d "${EXTRA_CONFIG_DIR:-}" ] && ls ${EXTRA_CONFIG_DIR}/*.yml &>/dev/null ; then
log_debug "EXTRA_CONFIG_DIR is configured and *.yml files are present, setting EXTRA_CONFIG_FILES"
EXTRA_CONFIG_FILES=${EXTRA_CONFIG_DIR}/*.yml
@ -250,11 +245,6 @@ generate_template_list() {
unset filelist_prepared filelist_final
}
timestamp_action() {
mkdir -p "${TIMESTAMP_DIR}"
touch "${TIMESTAMP_DIR}/${1}"
}
## }}}
## END OF FILE #################################################################

@ -36,79 +36,66 @@ fi
initialise() {
log_debug "${SCRIPTS}/initialise $*"
"${SCRIPTS}"/initialise $*
timestamp_action "initialise"
}
build() {
log_debug "${SCRIPTS}/build $*"
"${SCRIPTS}"/build $*
timestamp_action "build"
}
services() {
log_debug "${SCRIPTS}/services $*"
"${SCRIPTS}"/services $*
timestamp_action "services"
}
encrypt() {
log_debug "${SCRIPTS}/encrypt $*"
"${SCRIPTS}"/encrypt $*
timestamp_action "encrypt"
}
decrypt() {
log_debug "${SCRIPTS}/decrypt $*"
"${SCRIPTS}"/decrypt $*
timestamp_action "decrypt"
}
diff() {
log_debug "${SCRIPTS}/diff $*"
"${SCRIPTS}"/diff $*
timestamp_action "diff"
}
etckeeper() {
log_debug "${SCRIPTS}/etckeeper $*"
"${SCRIPTS}"/etckeeper $*
timestamp_action "etckeeper"
}
commit() {
log_debug "${SCRIPTS}/commit $*"
"${SCRIPTS}"/commit $*
timestamp_action "commit"
}
status() {
log_debug "${SCRIPTS}/status $*"
"${SCRIPTS}"/status $*
timestamp_action "status"
}
check() {
log_debug "${SCRIPTS}/check $*"
"${SCRIPTS}"/check $*
timestamp_action "check"
}
values() {
log_debug "${SCRIPTS}/values $*"
"${SCRIPTS}"/values $*
timestamp_action "values"
}
log() {
log_debug "${SCRIPTS}/log $*"
"${SCRIPTS}"/log $*
timestamp_action "log"
}
show() {
log_debug "${SCRIPTS}/show $*"
"${SCRIPTS}"/show $*
timestamp_action "show"
}
apply() {

@ -38,19 +38,6 @@ if check_for_outstanding_commits && [ -z "${1:-}" ] ; then
exit 1
fi
"${SCRIPTS}"/check
timestamp_action "check"
"${SCRIPTS}"/build
timestamp_action "build"
"${SCRIPTS}"/services
timestamp_action "services"
"${SCRIPTS}"/commit "$*"
timestamp_action "commit"
"${SCRIPTS}"/etckeeper
timestamp_action "etckeeper"
"${SCRIPTS}"/check && "${SCRIPTS}"/build && "${SCRIPTS}"/services && "${SCRIPTS}"/commit "$*" && "${SCRIPTS}"/etckeeper
## END OF FILE #################################################################

@ -116,36 +116,6 @@ check_remote() {
fi
}
check_pending_actions() {
log_debug "check_pending_actions"
log_debug "cd $NGCPCTL_MAIN"
cd "$NGCPCTL_MAIN"
log_info "Checking state of pending builds:"
local timestamp_commit=$(git log --format='%ct' -1)
log_debug "timestamp_commit = $timestamp_commit"
if ! [ -f "${TIMESTAMP_DIR}/build" ] ; then
log_debug "File ${TIMESTAMP_DIR}/build doesn't exist."
log_info "OK: no build/apply executed yet, nothing to do"
return 0
fi
local timestamp_build=$(stat --format='%Y' "${TIMESTAMP_DIR}/build")
log_debug "timestamp_build = $timestamp_build"
if [ -n "$timestamp_commit" ] && [ -n "$timestamp_build" ] ; then
local timediff=$(( timestamp_commit - timestamp_build ))
log_debug "timediff = $timediff"
if [ -n "$timediff" ] && [ "$timediff" -le 0 ] ; then
log_info "OK: nothing to build"
else
log_info "ACTION_NEEDED: commits without according build identified"
log_info "-> execute either 'ngcpcfg build' or 'ngcpcfg apply'"
fi
fi
}
check_reboot_requests() {
log_debug "check_requested_reboot"
@ -164,7 +134,6 @@ if [ -z "${1:-}" ] ; then
check_local_state
check_push
check_etc_state
check_pending_actions
check_shared_storage "$@"
check_reboot_requests
fi

Loading…
Cancel
Save