Commit 0778b08c authored by Kristopher Ruzic's avatar Kristopher Ruzic

fixed bugs in wendelin-show to make it useable (looks for right xml key), also...

fixed bugs in wendelin-show to make it useable (looks for right xml key), also replace erp5 with wendelin
parent df741bae
......@@ -18,7 +18,7 @@ def fmt_date():
def get_connection_information():
conn = sqlite3.connect("/opt/slapos/slapproxy.db")
cur = conn.cursor()
qry = cur.execute("SELECT connection_xml FROM partition11 WHERE connection_xml IS NOT NULL AND software_type='create-erp5-site'")
qry = cur.execute("SELECT connection_xml FROM partition11 WHERE connection_xml IS NOT NULL AND software_type='default'")
for row in qry:
xml = str(row[0])
break
......@@ -27,12 +27,11 @@ def get_connection_information():
try:
el = instance.getElementsByTagName('parameter')[0]
value = el.childNodes[0].nodeValue
json_text = json.loads(value)
return (json_text['family-admin'], json_text['inituser-password'])
return value
except Exception, e:
print e
print "empty"
return (None, None)
return None
def check_tables():
conn = sqlite3.connect("/opt/slapos/slapproxy.db")
......@@ -65,10 +64,9 @@ def get_build_status():
def status():
build = get_build_status()
if build:
zope_ip, pw = get_connection_information()
zope_ip = get_connection_information()
print ("Build successful, connect to:\n"
" " + zope_ip + " with\n"
" username: zope password: " + pw)
" " + zope_ip + " to access your Wendelin instance")
elif not build:
print "Your software is still building, be patient it can take awhile"
elif build == "err":
......@@ -77,12 +75,13 @@ def status():
def info():
if get_build_status():
print "Your wendelin instance can be found at: "
print get_connection_information()
else:
print "Information unavailable at this time, run " + sys.argv[0] + " -s for details"
def usage():
print ("Get the status and information of your ERP5 build\n"
print ("Get the status and information of your Wendelin build\n"
"Usage:")
print (" --help (-h): Print this message and exit\n"
" --status (-s): Print the status of the build\n"
......@@ -99,6 +98,9 @@ def main(argv):
except getopt.error, msg:
usage()
sys.exit(2)
if len(opts) == 0:
usage()
sys.exit(2)
# process arguments
for opt, arg in opts:
if opt in ("-h", "--help"):
......
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