mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #15440 from hulu/useradd
modules.useradd.get_loginclass: avoid shadowing outer info() func
This commit is contained in:
commit
32c99ce1d6
@ -531,9 +531,9 @@ def get_loginclass(name):
|
|||||||
'''
|
'''
|
||||||
if __grains__['kernel'] != 'OpenBSD':
|
if __grains__['kernel'] != 'OpenBSD':
|
||||||
return False
|
return False
|
||||||
info = __salt__['cmd.run_stdout']('userinfo {0}'.format(name),
|
userinfo = __salt__['cmd.run_stdout']('userinfo {0}'.format(name),
|
||||||
output_loglevel='debug')
|
output_loglevel='debug')
|
||||||
for line in info.splitlines():
|
for line in userinfo.splitlines():
|
||||||
if line.startswith("class"):
|
if line.startswith("class"):
|
||||||
loginclass = line.split()
|
loginclass = line.split()
|
||||||
if len(loginclass) == 2:
|
if len(loginclass) == 2:
|
||||||
|
Loading…
Reference in New Issue
Block a user