mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Use correct property name (#51511)
Add missing variable for storing returned file object. This prevents an I/O error because the f.writelines() call will be against a closed file.
This commit is contained in:
@@ -1909,7 +1909,7 @@ class SunOS(User):
|
||||
fields[5] = str(int(warnweeks) * 7)
|
||||
line = ':'.join(fields)
|
||||
lines.append('%s\n' % line)
|
||||
with open(self.SHADOWFILE, 'w+'):
|
||||
with open(self.SHADOWFILE, 'w+') as f:
|
||||
f.writelines(lines)
|
||||
rc = 0
|
||||
except Exception as err:
|
||||
@@ -1928,7 +1928,7 @@ class SunOS(User):
|
||||
with open(self.USER_ATTR, 'r') as file_handler:
|
||||
for line in file_handler:
|
||||
lines = line.strip().split('::::')
|
||||
if lines[0] == self.user:
|
||||
if lines[0] == self.name:
|
||||
tmp = dict(x.split('=') for x in lines[1].split(';'))
|
||||
info[0] = tmp.get('profiles', '')
|
||||
info[1] = tmp.get('auths', '')
|
||||
|
||||
Reference in New Issue
Block a user