mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 12:21:26 -07:00
Close all open filehandle (#50544)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
94a1d86d70
commit
db8702cdb8
21 changed files with 81 additions and 47 deletions
|
@ -77,8 +77,8 @@ def main():
|
|||
|
||||
data = None
|
||||
try:
|
||||
data = open(log_path).read()
|
||||
data = json.loads(data)
|
||||
with open(log_path) as f:
|
||||
data = json.loads(f.read())
|
||||
except Exception:
|
||||
if not data:
|
||||
# file not written yet? That means it is running
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue