Commit b3f07620 authored by Xavier Thompson's avatar Xavier Thompson

SlapObject: Fix unclosed file descriptor

parent f891eaaf
...@@ -513,7 +513,8 @@ class Partition(object): ...@@ -513,7 +513,8 @@ class Partition(object):
new_content = partition_certificate[name] new_content = partition_certificate[name]
old_content = None old_content = None
if os.path.exists(path): if os.path.exists(path):
old_content = open(path).read() with open(path) as f:
old_content = f.read()
if old_content != new_content: if old_content != new_content:
if old_content is None: if old_content is None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment