mirror of
https://github.com/xcat2/confluent.git
synced 2025-08-30 23:08:14 +00:00
Wait for redfish account service to be ready before modifying users
If an XCC is booting, it may appear before it's ready to use redfish to manage user accounts. Handle this by delaying the discovery until the service is ready.
This commit is contained in:
@@ -477,6 +477,13 @@ class NodeHandler(immhandler.NodeHandler):
|
||||
tmpaccount = None
|
||||
while status != 200:
|
||||
tries -= 1
|
||||
rsp, status = wc.grab_json_response_with_status(
|
||||
'/redfish/v1/AccountService/Accounts/{0}'.format(uid))
|
||||
if status >= 500:
|
||||
if tries < 0:
|
||||
raise Exception('Redfish account management failure')
|
||||
eventlet.sleep(30)
|
||||
continue
|
||||
rsp, status = wc.grab_json_response_with_status(
|
||||
'/redfish/v1/AccountService/Accounts/{0}'.format(uid),
|
||||
{'UserName': username}, method='PATCH')
|
||||
|
Reference in New Issue
Block a user