Fixes #5169 Evaluate check_mode in the user module SunOS class

pull/5140/head
James Tanner 11 years ago
parent 71a5de6e72
commit cbfeb0a2ea

@ -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