From 0d828d41088feb8ced201483e9f0466f6c1eb5ad Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 16 Dec 2015 16:42:20 +0100 Subject: [PATCH] MT#15973 Revert "MT#15973 Report in 'status' action when build/apply run is needed" This reverts commit db373d3927392bc2adf2cdae7aee5e2adfd84a65. 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 --- etc/ngcp-config/ngcpcfg.cfg | 3 --- functions/main | 10 ---------- sbin/ngcpcfg | 13 ------------- scripts/apply | 15 +-------------- scripts/status | 31 ------------------------------- 5 files changed, 1 insertion(+), 71 deletions(-) diff --git a/etc/ngcp-config/ngcpcfg.cfg b/etc/ngcp-config/ngcpcfg.cfg index 3841252f..20fd2f87 100644 --- a/etc/ngcp-config/ngcpcfg.cfg +++ b/etc/ngcp-config/ngcpcfg.cfg @@ -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' diff --git a/functions/main b/functions/main index ff3fbc02..81c33764 100644 --- a/functions/main +++ b/functions/main @@ -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 ################################################################# diff --git a/sbin/ngcpcfg b/sbin/ngcpcfg index d6cb5e4e..6c74ae15 100755 --- a/sbin/ngcpcfg +++ b/sbin/ngcpcfg @@ -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() { diff --git a/scripts/apply b/scripts/apply index a865b9ae..aa1b986e 100755 --- a/scripts/apply +++ b/scripts/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 ################################################################# diff --git a/scripts/status b/scripts/status index d2d3e3bb..367c0098 100755 --- a/scripts/status +++ b/scripts/status @@ -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