Skip to content

Commit 0024ab2

Browse files
authored
proxmox_user can't create user on PVE 9 #163 (#194)
* Fixes the bug, originally posted: #163 (comment) * Added changelog fragement
1 parent 202b7db commit 0024ab2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bugfixes:
2+
- proxmox_user - added a third case when testing for not-yet-existant user (https://github.com/ansible-collections/community.proxmox/issues/163)

plugins/modules/proxmox_user.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def is_user_existing(self, userid):
143143
user_data = self.proxmox_api.access.users(userid).get()
144144
return user_data
145145
except Exception as e:
146-
if "does not exist" in str(e).lower() or "not found" in str(e).lower():
146+
if "does not exist" in str(e).lower() or "not found" in str(e).lower() or "no such user" in str(e).lower():
147147
return False
148148
else:
149149
self.module.fail_json(msg="Unable to retrieve user {0}: {1}".format(userid, e))

0 commit comments

Comments
 (0)