Skip to content

Commit

Permalink
Lint fixes for getgroupall code
Browse files Browse the repository at this point in the history
  • Loading branch information
dlanderson committed Mar 14, 2014
1 parent ab11858 commit 3a3b061
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion salt/modules/cmdmod.py
Expand Up @@ -74,7 +74,7 @@ def _chugid(runas):
gid = __salt__['group.info'](group_name)['gid']
if (gid not in supgroups_seen
and not supgroups_seen.add(gid)):
supgroups.append(gid)
supgroups.append(gid)

# No logging can happen on this function
#
Expand Down
1 change: 0 additions & 1 deletion salt/modules/mac_user.py
Expand Up @@ -5,7 +5,6 @@

# Import python libs
try:
import grp
import pwd
except ImportError:
pass
Expand Down
1 change: 0 additions & 1 deletion salt/modules/pw_user.py
Expand Up @@ -5,7 +5,6 @@

# Import python libs
try:
import grp
import pwd
except ImportError:
pass
Expand Down
1 change: 0 additions & 1 deletion salt/modules/solaris_user.py
Expand Up @@ -5,7 +5,6 @@

# Import python libs
try:
import grp
import pwd
except ImportError:
pass
Expand Down
1 change: 0 additions & 1 deletion salt/modules/useradd.py
Expand Up @@ -7,7 +7,6 @@
import re

try:
import grp
import pwd
except ImportError:
pass
Expand Down
1 change: 0 additions & 1 deletion salt/states/user.py
Expand Up @@ -26,7 +26,6 @@

# Import python libs
import logging
import sys

# Import salt libs
import salt.utils
Expand Down
5 changes: 3 additions & 2 deletions salt/utils/__init__.py
Expand Up @@ -2097,6 +2097,7 @@ def repack_dictlist(data):
ret.update(element)
return ret


def get_group_list(user=None, include_default=True):
'''
Returns a list of all of the system group names of which the user
Expand All @@ -2111,7 +2112,7 @@ def get_group_list(user=None, include_default=True):
try:
group_names = list(os.getgrouplist(user, pwd.getpwnam(user).pw_gid))
log.trace('os.getgrouplist for user {0!r}: {1!r}'.format(user, group_names))
except:
except Exception:
pass
else:
# Try pysss.getgrouplist
Expand All @@ -2120,7 +2121,7 @@ def get_group_list(user=None, include_default=True):
import pysss
group_names = list(pysss.getgrouplist(user))
log.trace('pysss.getgrouplist for user {0!r}: {1!r}'.format(user, group_names))
except:
except Exception:
pass
if group_names is None:
# Fall back to generic code
Expand Down

0 comments on commit 3a3b061

Please sign in to comment.