Commit 2adeed22 authored by Ivan Tyagov's avatar Ivan Tyagov

Table names changed from index 13 to 14 in

b69b44f7bf36e5bfa8777c2f65d67e69df23e0ec
parent 206b4f15
...@@ -20,7 +20,7 @@ def fmt_date(): ...@@ -20,7 +20,7 @@ def fmt_date():
def discover_software(): def discover_software():
conn = sqlite3.connect("/opt/slapos/slapproxy.db") conn = sqlite3.connect("/opt/slapos/slapproxy.db")
cur = conn.cursor() 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]] return [row[0] for row in qry if row[0]]
def get_connection_information(software_release): def get_connection_information(software_release):
...@@ -34,7 +34,7 @@ def get_connection_information(software_release): ...@@ -34,7 +34,7 @@ def get_connection_information(software_release):
else: else:
raise ValueError 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 xml = None
for row in qry: for row in qry:
xml = str(row[0]) xml = str(row[0])
...@@ -75,7 +75,7 @@ def get_connection_information(software_release): ...@@ -75,7 +75,7 @@ def get_connection_information(software_release):
def check_tables(): def check_tables():
conn = sqlite3.connect("/opt/slapos/slapproxy.db") conn = sqlite3.connect("/opt/slapos/slapproxy.db")
cur = conn.cursor() 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: if qry is None:
print "tables aren't ready yet, your build may have failed, check logs in /opt/slapos/log/" 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 ...@@ -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 # Once caucase is merged and used by the master the need of this workarround will be gone, and
# A better configuration can be proposes # 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" local_access_comment="Local {{ playbook_name }} IPv4 access"
remote_access_comment="Remote {{ playbook_name }} IPv4 access" remote_access_comment="Remote {{ playbook_name }} IPv4 access"
......
#!/bin/bash #!/bin/bash
export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 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" local_access_comment="Local {{ playbook_name }} IPv4 access"
remote_access_comment="Remote {{ 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