Commit 70a72b13 authored by Jérome Perrin's avatar Jérome Perrin

slaprunner: fix the way of gessing slapproxy table name

The way introduced in b8c895cd was not
correct after database was updated, because update procedure do not
remove old tables.
parent fe835fff
......@@ -22,7 +22,7 @@ md5sum = 7c48c89f33ad243f0dffb3eeef8c56e8
[template-runner-import-script]
filename = template/runner-import.sh.jinja2
md5sum = ed6dc50713c14e2527b9958d98674eed
md5sum = bda1a5ddb01caff73b7bb29ec8b4f803
[instance-runner-import]
filename = instance-runner-import.cfg.in
......
......@@ -154,9 +154,11 @@ fi
# Slap proxy table contain version number, find the table name dynamically.
# This is known to work with version 11 or 12 of tables, but it will probably
# work with earlier versions as well.
DB_PARTITION_TABLE=$(db_query ".table partition__")
DB_PARTITION_NETWORK_TABLE=$(db_query ".table partition\_network__")
DB_SOFTWARE_TABLE=$(db_query ".table software__")
# When database is automatically migrated, the old tables are left around, so
# we use xargs|sort|tail to get only the latest table
DB_PARTITION_TABLE=$(db_query ".table partition__" | xargs -n1 | sort | tail -n1 )
DB_PARTITION_NETWORK_TABLE=$(db_query ".table partition\_network__" | xargs -n1 | sort | tail -n1 )
DB_SOFTWARE_TABLE=$(db_query ".table software__" | xargs -n1 | sort | tail -n1 )
# Change slapproxy database to point instances to new software release
# XXX hardcoded
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment