MT#4973 Check node specific execution of *_not_replicated.up scripts

Scripts that need to be executed on all hosts (the ones with
filename *_not_replicated.up) but have been executed on sp1
already are listed as "already executed" on sp2 if the
ngcp-check-rev-applied call doesn't use the node specific check.

So generate a list of *_not_replicated.up files and run
node specific checks while generating the list of missing
revision scripts.
vseva/5635
Michael Prokop 13 years ago
parent a7b88b64dc
commit 91b73e9019

@ -112,7 +112,23 @@ apply_revs() {
revs="$1"
for missing_revision in $(ngcp-check-rev-applied --schema db_schema --revision $revs | awk '/^No match for revision/ {print $5}') ; do
# generate list of rev scripts that are node specific, used inside
# missing_revision's ngcp-check-rev-applied ... --node $hostname
for rev in $revs ; do
revision_file="$(find /usr/share/ngcp-db-schema/ -name "$rev")"
case "$revision_file" in
*_not_replicated.up)
node_revs="$node_revs $rev"
;;
esac
done
for missing_revision in \
$( {
ngcp-check-rev-applied --schema db_schema --revision $revs | awk '/^No match for revision/ {print $5}' ;
ngcp-check-rev-applied --schema db_schema --revision $node_revs --node "$hostname" | awk '/^No match for revision/ {print $5}' ;
} | sort -z -n -u ) ; do
revision_file="$(find /usr/share/ngcp-db-schema/ -name "$missing_revision")"
# execute the rev script iff there's no entry for the *current* host yet

Loading…
Cancel
Save