Pavel Loginov 2021-08-19 22:14:54 +06:00
parent c5f07c320c
commit abb52ebb8f
1 changed files with 2 additions and 3 deletions

View File

@ -289,13 +289,12 @@ def update_server(hostname, group, typeip, enable, master, server_id, cred, port
def update_server_master(master, slave): def update_server_master(master, slave):
try: try:
master_id = Server.get(Server.server_id == master) master_id = Server.get(Server.ip == master).server_id
except Exception as e: except Exception as e:
out_error(e) out_error(e)
try: try:
server_update = Server.update(master=master_id).where(Server.ip == slave) Server.update(master=master_id).where(Server.ip == slave).execute()
server_update.execute()
except Exception as e: except Exception as e:
out_error(e) out_error(e)