Commit da3690fa authored by Rafael Monnerat's avatar Rafael Monnerat

slaprunner: Support resilience on computers with more them 100 partitions

  This block could be generalized a bit more but it will be unlikely to have computers with more them 1000 partitions.
parent 46124557
......@@ -23,7 +23,7 @@ md5sum = 8f49df215a1596efcec94e2cca009711
[template-runner-import-script]
filename = template/runner-import.sh.jinja2
md5sum = 3be3ff484a5aaa202f2ea72489a73285
md5sum = 130193114cbbcd014af9704851410605
[instance-runner-import]
filename = instance-runner-import.cfg.in
......
......@@ -136,7 +136,7 @@ DATABASE="$HOME/srv/runner/proxy.db"
# XXX hardcoded
PARTITION=$(basename $HOME)
OLD_SOFTWARE_RELEASE=$("$SQLITE3" "$DATABASE" "select software_release from partition11 where reference='slappart0';")
SOFTWARE_RELEASE=$(echo $OLD_SOFTWARE_RELEASE | sed -e 's/\(.*\)\(slappart\|test0-\)[0-9][0-9]\?/\1'"$PARTITION"'/')
SOFTWARE_RELEASE=$(echo $OLD_SOFTWARE_RELEASE | sed -e 's/\(.*\)\(slappart\|test0-\)[0-9][0-9][0-9]\?/\1'"$PARTITION"'/')
"$SQLITE3" "$DATABASE" "update partition11 set software_release='$SOFTWARE_RELEASE' where software_release NOT NULL;"
"$SQLITE3" "$DATABASE" "update software11 set url='$SOFTWARE_RELEASE' where url='$OLD_SOFTWARE_RELEASE';" || "$SQLITE3" "$DATABASE" "delete from software11 where url='$OLD_SOFTWARE_RELEASE';"
# Change slapproxy database to have all instances stopped
......
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