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