Commit ffbcaee7 authored by Łukasz Nowak's avatar Łukasz Nowak

fixup! [playbook] Make erp5-show aware of Wendelin

"wendelin" key is used in many places in the playbook and slapos so it
is required to find infromation with this key.
parent 20253ba0
......@@ -28,8 +28,10 @@ def get_connection_information(software_release):
conn = sqlite3.connect("/opt/slapos/slapproxy.db")
cur = conn.cursor()
if 'software/erp5' in software_release or 'software/wendelin' in software_release:
if 'software/erp5' in software_release:
partition_reference = 'instance-of-erp5'
elif 'software/wendelin' in software_release:
partition_reference = 'instance-of-wendelin'
elif 'software/apache-frontend' in software_release:
partition_reference = 'apache-frontend-1'
else:
......@@ -45,7 +47,7 @@ def get_connection_information(software_release):
return (None, None)
instance = minidom.parseString(xml)
if partition_reference == 'instance-of-erp5':
if partition_reference in ['instance-of-erp5', 'instance-of-wendelin']:
try:
el = instance.getElementsByTagName('parameter')[0]
value = el.childNodes[0].nodeValue
......@@ -120,8 +122,14 @@ def status():
frn_sr = [q for q in software_release_list
if 'software/apache-frontend' in q][0]
zope_ip, pw = get_connection_information(erp5_sr)
if 'software/erp5' in erp5_sr:
filename = '/tmp/playbook-erp5-public-ipv4'
elif 'software/wendelin' in erp5_sr:
filename = '/tmp/playbook-wendelin-public-ipv4'
else:
raise ValueError
try:
ip = open('/tmp/playbook-erp5-public-ipv4').read()
ip = open(filename).read()
except Exception:
frontend = None
else:
......
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