Commit 2ab7074d authored by Ivan Tyagov's avatar Ivan Tyagov Committed by Thomas Gambier

Fix proxy table names

@rafael  or @tomo 

Please feel free to merge in so we can have deployment tests working back again.

/reviewed-on !101
parent 206b4f15
......@@ -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 software13")
qry = cur.execute("SELECT DISTINCT url FROM software14")
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 partition13 WHERE connection_xml IS NOT NULL AND software_release=? AND partition_reference LIKE ?", (software_release, partition_reference) )
qry = cur.execute("SELECT connection_xml FROM partition14 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 = 'partition13' THEN 1 ELSE 0 END FROM sqlite_master WHERE tbl_name = 'partition13' AND type = 'table'")
qry = cur.execute("SELECT CASE WHEN tbl_name = 'partition14' THEN 1 ELSE 0 END FROM sqlite_master WHERE tbl_name = 'partition14' AND type = 'table'")
if qry is None:
print "tables aren't ready yet, your build may have failed, check logs in /opt/slapos/log/"
......
......@@ -5,7 +5,7 @@ export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Once caucase is merged and used by the master the need of this workarround will be gone, and
# A better configuration can be proposes
slap_ipv4=`/opt/slapos/parts/sqlite3/bin/sqlite3 /opt/slapos/slapproxy.db "select address from partition_network13 where partition_reference=(select reference from partition13 where software_type = 'balancer' and requested_by = (select reference from partition13 where partition_reference='{{ backend_instance_reference }}')) and netmask='255.255.255.255';"`
slap_ipv4=`/opt/slapos/parts/sqlite3/bin/sqlite3 /opt/slapos/slapproxy.db "select address from partition_network14 where partition_reference=(select reference from partition14 where software_type = 'balancer' and requested_by = (select reference from partition14 where partition_reference='{{ backend_instance_reference }}')) and netmask='255.255.255.255';"`
local_access_comment="Local {{ playbook_name }} IPv4 access"
remote_access_comment="Remote {{ playbook_name }} IPv4 access"
......
#!/bin/bash
export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
frontend_ipv4=`/opt/slapos/parts/sqlite3/bin/sqlite3 /opt/slapos/slapproxy.db "select address from partition_network13 where partition_reference=(select reference from partition13 where requested_by = (select reference from partition13 where partition_reference='{{ frontend_master_reference }}')) and netmask='255.255.255.255';"`
frontend_ipv4=`/opt/slapos/parts/sqlite3/bin/sqlite3 /opt/slapos/slapproxy.db "select address from partition_network14 where partition_reference=(select reference from partition14 where requested_by = (select reference from partition14 where partition_reference='{{ frontend_master_reference }}')) and netmask='255.255.255.255';"`
local_access_comment="Local {{ playbook_name }} IPv4 access"
remote_access_comment="Remote {{ playbook_name }} IPv4 access"
......
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