Commit 48f2b1a8 authored by Jérome Perrin's avatar Jérome Perrin

erp5-show: assume version 12 of slap proxy database

parent 3a0c76b7
......@@ -20,7 +20,7 @@ def fmt_date():
def discover_software():
conn = sqlite3.connect("/opt/slapos/slapproxy.db")
cur = conn.cursor()
qry = cur.execute("SELECT DISTINCT url FROM software11")
qry = cur.execute("SELECT DISTINCT url FROM software12")
return [row[0] for row in qry if row[0]]
def get_connection_information(software_release):
......@@ -34,7 +34,7 @@ def get_connection_information(software_release):
else:
raise ValueError
qry = cur.execute("SELECT connection_xml FROM partition11 WHERE connection_xml IS NOT NULL AND software_release=? AND partition_reference LIKE ?", (software_release, partition_reference) )
qry = cur.execute("SELECT connection_xml FROM partition12 WHERE connection_xml IS NOT NULL AND software_release=? AND partition_reference LIKE ?", (software_release, partition_reference) )
xml = None
for row in qry:
xml = str(row[0])
......@@ -75,7 +75,7 @@ def get_connection_information(software_release):
def check_tables():
conn = sqlite3.connect("/opt/slapos/slapproxy.db")
cur = conn.cursor()
qry = cur.execute("SELECT CASE WHEN tbl_name = 'partition11' THEN 1 ELSE 0 END FROM sqlite_master WHERE tbl_name = 'partition11' AND type = 'table'")
qry = cur.execute("SELECT CASE WHEN tbl_name = 'partition12' THEN 1 ELSE 0 END FROM sqlite_master WHERE tbl_name = 'partition12' AND type = 'table'")
if qry is None:
print "tables aren't ready yet, your build may have failed, check logs in /opt/slapos/log/"
......
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