mirror of
https://github.com/ansible/awx.git
synced 2026-01-09 23:12:08 -03:30
Close file before returning
This commit is contained in:
parent
2afa406b7f
commit
02cccbe608
@ -89,9 +89,9 @@ def load_file(filename):
|
||||
path = local(filename)
|
||||
|
||||
if path.check():
|
||||
fp = path.open()
|
||||
# FIXME - support load_all()
|
||||
return yaml.load(fp, Loader=Loader)
|
||||
with open(path, 'r') as fp:
|
||||
# FIXME - support load_all()
|
||||
return yaml.load(fp, Loader=Loader)
|
||||
else:
|
||||
msg = 'Unable to load data file at %s' % path
|
||||
raise Exception(msg)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user