mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-03 06:49:10 -07:00
[PR #7085/a8809401 backport][stable-7] Avoid direct type comparisons (#7086)
Avoid direct type comparisons (#7085)
Avoid direct type comparisons.
(cherry picked from commit a8809401ee
)
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
1a801323a8
commit
719ecc9e85
5 changed files with 19 additions and 16 deletions
|
@ -193,14 +193,14 @@ class ProxmoxUser:
|
|||
self.user[k] = v
|
||||
elif k in ['groups', 'tokens'] and (v == '' or v is None):
|
||||
self.user[k] = []
|
||||
elif k == 'groups' and type(v) == str:
|
||||
elif k == 'groups' and isinstance(v, str):
|
||||
self.user['groups'] = v.split(',')
|
||||
elif k == 'tokens' and type(v) == list:
|
||||
elif k == 'tokens' and isinstance(v, list):
|
||||
for token in v:
|
||||
if 'privsep' in token:
|
||||
token['privsep'] = proxmox_to_ansible_bool(token['privsep'])
|
||||
self.user['tokens'] = v
|
||||
elif k == 'tokens' and type(v) == dict:
|
||||
elif k == 'tokens' and isinstance(v, dict):
|
||||
self.user['tokens'] = list()
|
||||
for tokenid, tokenvalues in v.items():
|
||||
t = tokenvalues
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue