sql=""" select slave.ip from servers left join servers as slave on servers.id = slave.master where servers.ip = '%s'"""%ip
sql=""" select slave.ip from servers as master left join servers as slave on master.id = slave.master where master.ip = '%s'"""%ip
ifkwargs.get('master_slave'):
sql=""" select master.hostname, master.ip, slave.hostname, slave.ip from servers as master left join servers as slave on master.id = slave.master where slave.master > 0 """
try:
cur.execute(sql)
exceptsqltool.Errorase:
returnFalse
print("An error occurred:",e)
else:
returncur.fetchall()
cur.close()
con.close()
defshow_update_servers():
SERVERS=select_servers()
@ -490,6 +492,7 @@ if form.getvalue('userdel') is not None:
print("Ok")
ifform.getvalue('newserver')isnotNone:
importfunct
hostname=form.getvalue('newserver')
ip=form.getvalue('newip')
group=form.getvalue('newservergroup')
@ -501,8 +504,11 @@ if form.getvalue('newserver') is not None: