Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Hardik Juneja
slapos
Commits
897ca020
Commit
897ca020
authored
Sep 26, 2017
by
Hardik Juneja
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Slaprunner: Runner Import (sqlite3) change to WAL mode to avoid database locked error
parent
20c21929
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
software/slaprunner/buildout.hash.cfg
software/slaprunner/buildout.hash.cfg
+1
-1
software/slaprunner/template/runner-import.sh.jinja2
software/slaprunner/template/runner-import.sh.jinja2
+3
-0
No files found.
software/slaprunner/buildout.hash.cfg
View file @
897ca020
...
@@ -31,7 +31,7 @@ md5sum = 5cfa49bcf20612844e1c50a85740d0b3
...
@@ -31,7 +31,7 @@ md5sum = 5cfa49bcf20612844e1c50a85740d0b3
[template-runner-export-script]
[template-runner-export-script]
filename = template/runner-export.sh.jinja2
filename = template/runner-export.sh.jinja2
md5sum =
94c0eddb2af3290942f64e04f95a707c
md5sum =
827c1b58b8b740820030b4bc96b8ec16
[instance-runner-export]
[instance-runner-export]
filename = instance-runner-export.cfg.in
filename = instance-runner-export.cfg.in
...
...
software/slaprunner/template/runner-import.sh.jinja2
View file @
897ca020
...
@@ -135,6 +135,8 @@ DATABASE="$HOME/srv/runner/proxy.db"
...
@@ -135,6 +135,8 @@ DATABASE="$HOME/srv/runner/proxy.db"
# Change slapproxy database to point instances to new software release
# Change slapproxy database to point instances to new software release
# XXX hardcoded
# XXX hardcoded
PARTITION=$(basename $HOME)
PARTITION=$(basename $HOME)
# Change to WAL mode to avoide locks
"$SQLITE3" "$DATABASE" "PRAGMA journal_mode=WAL;"
OLD_SOFTWARE_RELEASE=$("$SQLITE3" "$DATABASE" "select software_release from partition11 where reference='slappart0';")
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][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 partition11 set software_release='$SOFTWARE_RELEASE' where software_release NOT NULL;"
...
@@ -146,6 +148,7 @@ IPV4='{{ ipv4 }}'
...
@@ -146,6 +148,7 @@ IPV4='{{ ipv4 }}'
IPV6='{{ ipv6 }}'
IPV6='{{ ipv6 }}'
"$SQLITE3" "$DATABASE" "update partition_network11 set address='$IPV4' where netmask='255.255.255.255';"
"$SQLITE3" "$DATABASE" "update partition_network11 set address='$IPV4' where netmask='255.255.255.255';"
"$SQLITE3" "$DATABASE" "update partition_network11 set address='$IPV6' where netmask='ffff:ffff:ffff::';"
"$SQLITE3" "$DATABASE" "update partition_network11 set address='$IPV6' where netmask='ffff:ffff:ffff::';"
"$SQLITE3" "PRAGMA journal_mode=DELETE;"
MASTERURL='http://{{ ipv4 }}:{{ proxy_port }}'
MASTERURL='http://{{ ipv4 }}:{{ proxy_port }}'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment