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):
try:
master_id = Server.get(Server.server_id == master)
master_id = Server.get(Server.ip == master).server_id
except Exception as e:
out_error(e)
try:
server_update = Server.update(master=master_id).where(Server.ip == slave)
server_update.execute()
Server.update(master=master_id).where(Server.ip == slave).execute()
except Exception as e:
out_error(e)