|
|
@ -1360,11 +1360,10 @@ class SunOS(User):
|
|
|
|
cmd.append('-s')
|
|
|
|
cmd.append('-s')
|
|
|
|
cmd.append(self.shell)
|
|
|
|
cmd.append(self.shell)
|
|
|
|
|
|
|
|
|
|
|
|
if self.module.check_mode:
|
|
|
|
|
|
|
|
return (0, '', '')
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
# modify the user if cmd will do anything
|
|
|
|
# modify the user if cmd will do anything
|
|
|
|
if cmd_len != len(cmd):
|
|
|
|
if cmd_len != len(cmd):
|
|
|
|
|
|
|
|
(rc, out, err) = (0, '', '')
|
|
|
|
|
|
|
|
if not self.module.check_mode:
|
|
|
|
cmd.append(self.name)
|
|
|
|
cmd.append(self.name)
|
|
|
|
(rc, out, err) = self.execute_command(cmd)
|
|
|
|
(rc, out, err) = self.execute_command(cmd)
|
|
|
|
if rc is not None and rc != 0:
|
|
|
|
if rc is not None and rc != 0:
|
|
|
@ -1374,6 +1373,8 @@ class SunOS(User):
|
|
|
|
|
|
|
|
|
|
|
|
# we have to set the password by editing the /etc/shadow file
|
|
|
|
# we have to set the password by editing the /etc/shadow file
|
|
|
|
if self.update_password == 'always' and self.password is not None and info[1] != self.password:
|
|
|
|
if self.update_password == 'always' and self.password is not None and info[1] != self.password:
|
|
|
|
|
|
|
|
(rc, out, err) = (0, '', '')
|
|
|
|
|
|
|
|
if not self.module.check_mode:
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
lines = []
|
|
|
|
lines = []
|
|
|
|
for line in open(self.SHADOWFILE, 'rb').readlines():
|
|
|
|
for line in open(self.SHADOWFILE, 'rb').readlines():
|
|
|
|