Really minor optimization and style change for d0e3d75381
* Use a generator expression instead of a list comprehension * Use copy() to create a new set instead of the constructor.
This commit is contained in:
parent
d0e3d75381
commit
a31e9bd9ea
1 changed files with 2 additions and 2 deletions
|
@ -552,8 +552,8 @@ class User(object):
|
|||
if self.groups is None:
|
||||
return None
|
||||
info = self.user_info()
|
||||
groups = set([x.strip() for x in self.groups.split(',') if x])
|
||||
for g in set(groups):
|
||||
groups = set(x.strip() for x in self.groups.split(',') if x)
|
||||
for g in groups.copy():
|
||||
if not self.group_exists(g):
|
||||
self.module.fail_json(msg="Group %s does not exist" % (g))
|
||||
if info and remove_existing and self.group_info(g)[2] == info[3]:
|
||||
|
|
Loading…
Reference in a new issue