Fixes #5169 Evaluate check_mode in the user module SunOS class

reviewable/pr18780/r1
James Tanner 11 years ago
parent 608a0ef220
commit 3bb1a263cf

@ -1137,6 +1137,9 @@ class SunOS(User):
cmd.append(self.name)
if self.module.check_mode:
return (0, '', '')
else:
(rc, out, err) = self.execute_command(cmd)
if rc is not None and rc != 0:
self.module.fail_json(name=self.name, msg=err, rc=rc)
@ -1214,6 +1217,9 @@ class SunOS(User):
cmd.append('-s')
cmd.append(self.shell)
if self.module.check_mode:
return (0, '', '')
else:
# modify the user if cmd will do anything
if cmd_len != len(cmd):
cmd.append(self.name)

Loading…
Cancel
Save