Make salt.modules.pw_user.get_loginclass return string rather than dict

This aligns with salt.modules.useradd.get_loginclass which is used
for OpenBSD.

This fixes salt.modules.pw_user.chloginclass which is used for FreeBSD
and expects a string to be returned. This was therefore returning False
even after successfully changing the loginclass.

This also fixes salt.states.user.present on FreeBSD when loginclass is
set.
This commit is contained in:
Ben Woods 2017-04-17 12:29:37 +08:00 committed by rallytime
parent 2ae9eaa176
commit d6c436246b

View File

@ -475,7 +475,7 @@ def get_loginclass(name):
userinfo = __salt__['cmd.run_stdout'](['pw', 'usershow', '-n', name])
userinfo = userinfo.split(':')
return {'loginclass': userinfo[4] if len(userinfo) == 10 else ''}
return userinfo[4] if len(userinfo) == 10 else ''
def list_groups(name):