Unindenting the delete to user (#3147)
This commit is contained in:
parent
962a446238
commit
cd09aab9b4
1 changed files with 3 additions and 4 deletions
|
@ -196,11 +196,10 @@ def delete_user(module, iam, name):
|
|||
except boto.exception.BotoServerError, err:
|
||||
error_msg = boto_exception(err)
|
||||
if ('Cannot find Login Profile') in error_msg:
|
||||
|
||||
del_meta = iam.delete_user(name).delete_user_response
|
||||
else:
|
||||
iam.delete_login_profile(name)
|
||||
del_meta = iam.delete_user(name).delete_user_response
|
||||
else:
|
||||
iam.delete_login_profile(name)
|
||||
del_meta = iam.delete_user(name).delete_user_response
|
||||
except Exception as ex:
|
||||
module.fail_json(changed=False, msg="delete failed %s" %ex)
|
||||
if ('must detach all policies first') in error_msg:
|
||||
|
|
Loading…
Reference in a new issue