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
OpenGnSys Support Team 2024-02-19 11:15:56 +01:00
parent 6ec26d161e
commit 8fa2d07134
1 changed files with 9 additions and 1 deletions

View File

@ -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