Yedidyah Bar David has uploaded a new change for review. Change subject: packaging: engine-backup: Allow multiple scopes ......................................................................
packaging: engine-backup: Allow multiple scopes Allow passing '--scope=' more than once. Change-Id: I331900e5ca92bd91196189cf584694c64bddf240 Bug-Url: https://bugzilla.redhat.com/1208122 Signed-off-by: Yedidyah Bar David <d...@redhat.com> --- M packaging/bin/engine-backup.sh 1 file changed, 40 insertions(+), 27 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/25/40325/1 diff --git a/packaging/bin/engine-backup.sh b/packaging/bin/engine-backup.sh index ac45ef0..04efac4 100755 --- a/packaging/bin/engine-backup.sh +++ b/packaging/bin/engine-backup.sh @@ -154,6 +154,7 @@ db engine database only dwhdb dwh database only reportsdb reports database only + The option --scope can be passed more than once, with different scopes --file=FILE file to use during backup or restore --log=FILE log file to use --archive-compressor=COMPRESSOR @@ -256,7 +257,8 @@ } MODE= -SCOPE=all +DEFAULT_SCOPE=all +SCOPE= SCOPE_FILES= SCOPE_ENGINE_DB= SCOPE_DWH_DB= @@ -344,6 +346,37 @@ echo "${res}" } +set_scope() { + local s="$1" + case "${s}" in + all) + SCOPE_FILES=1 + SCOPE_ENGINE_DB=1 + SCOPE_DWH_DB=1 + SCOPE_REPORTS_DB=1 + ;; + files) + SCOPE_FILES=1 + ;; + db) + SCOPE_ENGINE_DB=1 + ;; + dwhdb) + SCOPE_DWH_DB=1 + ;; + reportsdb) + SCOPE_REPORTS_DB=1 + ;; + *) die "invalid scope '${s}'" + esac + + if [ -z "${SCOPE}" ]; then + SCOPE="${s}" + else + SCOPE="${SCOPE},${s}" + fi +} + parseArgs() { local DB_PASSFILE @@ -360,11 +393,7 @@ esac ;; --scope=*) - SCOPE="${v}" - case "${SCOPE}" in - all|files|db|dwhdb|reportsdb) ;; - *) die "invalid scope '${SCOPE}'" - esac + set_scope "${v}" ;; --file=*) FILE="${v}" @@ -532,27 +561,9 @@ esac done - case "${SCOPE}" in - all) - SCOPE_FILES=1 - SCOPE_ENGINE_DB=1 - SCOPE_DWH_DB=1 - SCOPE_REPORTS_DB=1 - ;; - files) - SCOPE_FILES=1 - ;; - db) - SCOPE_ENGINE_DB=1 - ;; - dwhdb) - SCOPE_DWH_DB=1 - ;; - reportsdb) - SCOPE_REPORTS_DB=1 - ;; - *) die "invalid scope '${SCOPE}'" - esac + if [ -z "${SCOPE}" ]; then + set_scope "${DEFAULT_SCOPE}" + fi } verifyArgs() { @@ -1215,3 +1226,5 @@ generatePgPass do${MODE} output "Done." + +# vim: set noexpandtab shiftwidth=8 tabstop=8: -- To view, visit https://gerrit.ovirt.org/40325 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I331900e5ca92bd91196189cf584694c64bddf240 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yedidyah Bar David <d...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches