mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
use open() as context manager (#9579)
* use open() as context manager * add changelog frag
This commit is contained in:
@@ -308,9 +308,8 @@ class Rhsm(object):
|
||||
else:
|
||||
cfg.set('main', 'enabled', '0')
|
||||
|
||||
fd = open(tmpfile, 'w+')
|
||||
cfg.write(fd)
|
||||
fd.close()
|
||||
with open(tmpfile, 'w+') as fd:
|
||||
cfg.write(fd)
|
||||
self.module.atomic_move(tmpfile, plugin_conf)
|
||||
|
||||
def enable(self):
|
||||
|
||||
Reference in New Issue
Block a user