git://git.onelab.eu
/
nepi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
systematic use of context managers for dealing with files instead of open()/close...
[nepi.git]
/
src
/
nepi
/
resources
/
linux
/
node.py
diff --git
a/src/nepi/resources/linux/node.py
b/src/nepi/resources/linux/node.py
index
16b9b00
..
df3030b
100644
(file)
--- a/
src/nepi/resources/linux/node.py
+++ b/
src/nepi/resources/linux/node.py
@@
-477,7
+477,8
@@
class LinuxNode(ResourceManager):
########################
import pickle
########################
import pickle
- pids = pickle.load(open("/tmp/save.proc", "rb"))
+ with open("/tmp/save.proc", "rb") as pickle_file:
+ pids = pickle.load(pickle_file)
pids_temp = dict()
ps_aux = "ps aux | awk '{print $2,$11}'"
(out, err), proc = self.execute(ps_aux)
pids_temp = dict()
ps_aux = "ps aux | awk '{print $2,$11}'"
(out, err), proc = self.execute(ps_aux)