Merge pull request #5490 from rgbj/devel
user module/OpenBSD: using login_class always makes status 'changed'
This commit is contained in:
commit
da9cd8e018
1 changed files with 15 additions and 2 deletions
13
system/user
13
system/user
|
@ -901,6 +901,19 @@ class OpenBSDUser(User):
|
||||||
cmd.append(self.shell)
|
cmd.append(self.shell)
|
||||||
|
|
||||||
if self.login_class is not None:
|
if self.login_class is not None:
|
||||||
|
# find current login class
|
||||||
|
user_login_class = None
|
||||||
|
userinfo_cmd = [self.module.get_bin_path('userinfo', True), self.name]
|
||||||
|
(rc, out, err) = self.execute_command(userinfo_cmd)
|
||||||
|
|
||||||
|
for line in out.splitlines():
|
||||||
|
tokens = line.split()
|
||||||
|
|
||||||
|
if tokens[0] == 'class' and len(tokens) == 2:
|
||||||
|
user_login_class = tokens[1]
|
||||||
|
|
||||||
|
# act only if login_class change
|
||||||
|
if self.login_class != user_login_class:
|
||||||
cmd.append('-L')
|
cmd.append('-L')
|
||||||
cmd.append(self.login_class)
|
cmd.append(self.login_class)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue