Skip to content

Commit

Permalink
fixed ansible#28183 - user module shadowfile update on SunOS (ansible…
Browse files Browse the repository at this point in the history
…#28276)

* fixed ansible#28183 - user module shadowfile update on SunOS
  • Loading branch information
c0psrul3 authored and abadger committed Aug 19, 2017
1 parent 76bcce7 commit b5a00d0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/ansible/modules/system/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -1348,6 +1348,7 @@ def create_user(self):
try:
lines = []
for line in open(self.SHADOWFILE, 'rb').readlines():
line = to_native(line, errors='surrogate_or_strict')
fields = line.strip().split(':')
if not fields[0] == self.name:
lines.append(line)
Expand Down Expand Up @@ -1442,6 +1443,7 @@ def modify_user_usermod(self):
try:
lines = []
for line in open(self.SHADOWFILE, 'rb').readlines():
line = to_native(line, errors='surrogate_or_strict')
fields = line.strip().split(':')
if not fields[0] == self.name:
lines.append(line)
Expand Down

0 comments on commit b5a00d0

Please sign in to comment.