tower: Handle AuthError (#53377)

Handle AuthError raised when user provides incorrect password
for Tower admin user.

Fixes: #50535

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde 2019-03-06 16:48:43 +05:30 committed by ansibot
commit 5b0eae75fa
23 changed files with 23 additions and 23 deletions

View file

@ -307,7 +307,7 @@ def main():
result = credential.delete(**params)
except (exc.NotFound) as excinfo:
module.fail_json(msg='Failed to update credential, organization not found: {0}'.format(excinfo), changed=False)
except (exc.ConnectionError, exc.BadRequest, exc.NotFound) as excinfo:
except (exc.ConnectionError, exc.BadRequest, exc.NotFound, exc.AuthError) as excinfo:
module.fail_json(msg='Failed to update credential: {0}'.format(excinfo), changed=False)
json_output['changed'] = result['changed']