mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-25 02:52:07 +00:00
Provide resource to check if http has been initialized
This allows clients to know if they need to direct user to do early setup procedures.
This commit is contained in:
parent
b1f8cf8f12
commit
5df30881f8
@ -655,6 +655,15 @@ def resourcehandler_backend(env, start_response):
|
||||
yield res
|
||||
return
|
||||
reqpath = env.get('PATH_INFO', '')
|
||||
if reqpath == '/httpapi_initialized':
|
||||
if (len(configmanager.ConfigManager(None).list_usergroups()) > 0
|
||||
or len(configmanager.ConfigManager(None).list_users()) > 0):
|
||||
start_response('200 OK', headers)
|
||||
yield ''
|
||||
return
|
||||
start_response('500 No authorized users', headers)
|
||||
yield ''
|
||||
return
|
||||
if reqpath.startswith('/boot/'):
|
||||
request = env['PATH_INFO'].split('/')
|
||||
if not request[0]:
|
||||
|
Loading…
Reference in New Issue
Block a user