git://git.onelab.eu
/
nodemanager.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
hopefully fewer leaks in files : always use a context manager to open files
[nodemanager.git]
/
nodemanager.py
diff --git
a/nodemanager.py
b/nodemanager.py
index
c0a5656
..
d397a4b
100755
(executable)
--- a/
nodemanager.py
+++ b/
nodemanager.py
@@
-232,7
+232,8
@@
If this is not the case, please remove the pid file {}. -- exiting""".format(oth
# Load /etc/planetlab/session
if os.path.exists(self.options.session):
- session = file(self.options.session).read().strip()
+ with open(self.options.session) as f:
+ session = f.read().strip()
else:
session = None