From 2317a9039c01fae9f2d95b5668dd7697adda60ac Mon Sep 17 00:00:00 2001 From: Alexander Lutay Date: Tue, 3 May 2016 11:53:28 +0200 Subject: [PATCH] MT#19571 Add ngcpcfg option to force validation Mainly nobody validate the schema in trunk right now as it requires manual changes for ngcpcfg.cfg. Also having force validation will allow us to add validation in ngcp-upgrade and Jenkins nightly builds. Change-Id: Ia48a778ecf7dae30b26bdff0c5dd5b9000c9d089 --- docs/ngcpcfg.txt | 4 ++++ sbin/ngcpcfg | 1 + scripts/check | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/ngcpcfg.txt b/docs/ngcpcfg.txt index a22b53b6..dce1f70c 100644 --- a/docs/ngcpcfg.txt +++ b/docs/ngcpcfg.txt @@ -198,6 +198,10 @@ Note: This option is available in the High Availability setup only. Ignore schema validation results for YAML files (syntax check is still performed). + **--validate** []:: + +Force schema validation for YAML files even if validation is disabled in config. + **--version**:: Display ngcpcfg version and exit. diff --git a/sbin/ngcpcfg b/sbin/ngcpcfg index 9b336987..5a455115 100755 --- a/sbin/ngcpcfg +++ b/sbin/ngcpcfg @@ -118,6 +118,7 @@ case ${1:-} in --no-db-sync) export NO_DB_SYNC=1 ; shift ; "$0" "$@" ;; --no-validate) export NO_VALIDATE=1; shift ; "$0" "$@" ;; --no-action-failure) export NO_ACTION_FAILURE=1; shift ; "$0" "$@" ;; + --validate) export VALIDATE=1; shift ; "$0" "$@" ;; -h|--help|help) usage ; exit 0;; -v|--version|version) version ; exit 0;; *) usage 1; exit 1;; diff --git a/scripts/check b/scripts/check index b6b9e9b2..2bf8e5d7 100755 --- a/scripts/check +++ b/scripts/check @@ -144,7 +144,7 @@ fi check_branch check_configs -if "${VALIDATE_SCHEMA:-false}" ; then +if "${VALIDATE_SCHEMA:-false}" || [ "${VALIDATE:-0}" = "1" ] ; then validate_config fi check_configs_conflicts