mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fixes #5169 Evaluate check_mode in the user module SunOS class
This commit is contained in:
parent
71a5de6e72
commit
cbfeb0a2ea
1 changed files with 49 additions and 43 deletions
|
@ -1137,6 +1137,9 @@ class SunOS(User):
|
||||||
|
|
||||||
cmd.append(self.name)
|
cmd.append(self.name)
|
||||||
|
|
||||||
|
if self.module.check_mode:
|
||||||
|
return (0, '', '')
|
||||||
|
else:
|
||||||
(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:
|
||||||
self.module.fail_json(name=self.name, msg=err, rc=rc)
|
self.module.fail_json(name=self.name, msg=err, rc=rc)
|
||||||
|
@ -1214,6 +1217,9 @@ 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):
|
||||||
cmd.append(self.name)
|
cmd.append(self.name)
|
||||||
|
|
Loading…
Reference in a new issue