mirror of https://git.48k.eu/ogcp
views: call POST /refresh from get_client_setup()
Refresh the disk layout before any command that displays it, no need to manually call command -> refresh. this cannot be skipped, POST /setup is an asynchronous invocation in ogserver is asynchronous, POST /refresh provides the existing disk layout, otherwise it shows the existing layout in the database which is not complete. this is also good in case someone manipulates the disk from the command line.master
parent
6ec26d161e
commit
8fa2d07134
|
@ -120,8 +120,16 @@ def parse_elements(checkboxes_dict):
|
|||
return elements
|
||||
|
||||
def get_client_setup(ip):
|
||||
payload = {'client': [ip]}
|
||||
server = get_server_from_clients([ip])
|
||||
|
||||
payload = {'clients': [ip]}
|
||||
r = server.post('/refresh', payload)
|
||||
if not r:
|
||||
raise ServerError
|
||||
if r.status_code != requests.codes.ok:
|
||||
raise ServerErrorCode
|
||||
|
||||
payload = {'client': [ip]}
|
||||
r = server.get('/client/setup', payload)
|
||||
if not r:
|
||||
raise ServerError
|
||||
|
|
Loading…
Reference in New Issue