mirror of
https://github.com/xcat2/confluent.git
synced 2024-12-25 04:32:11 +00:00
Provide better error on nodediscover assign
Rather than the rather useless unexpected error, actually describe specific cases of wrong username or password.
This commit is contained in:
parent
cb2133e871
commit
c227c2353b
@ -394,8 +394,15 @@ def handle_api_request(configmanager, inputdata, operation, pathcomponents):
|
||||
'Unable to {0} to {1}'.format(operation,
|
||||
'/'.join(pathcomponents)))
|
||||
handler = info['handler'].NodeHandler(info, configmanager)
|
||||
eval_node(configmanager, handler, info, inputdata['node'],
|
||||
manual=True)
|
||||
try:
|
||||
eval_node(configmanager, handler, info, inputdata['node'],
|
||||
manual=True)
|
||||
except Exception as e:
|
||||
# or... incorrect passworod provided..
|
||||
if 'Incorrect password' in str(e) or 'Unauthorized name' in str(e):
|
||||
return [msg.ConfluentTargetInvalidCredentials(
|
||||
inputdata['node'])]
|
||||
raise
|
||||
return [msg.AssignedResource(inputdata['node'])]
|
||||
elif operation == 'delete':
|
||||
mac = _get_mac_from_query(pathcomponents)
|
||||
|
Loading…
Reference in New Issue
Block a user