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
cherry picked cb5d027b about context managers
[nepi.git]
/
src
/
nepi
/
resources
/
planetlab
/
scripts
/
pl-vif-create.py
diff --git
a/src/nepi/resources/planetlab/scripts/pl-vif-create.py
b/src/nepi/resources/planetlab/scripts/pl-vif-create.py
index
3b02e0c
..
bd45a0c
100644
(file)
--- a/
src/nepi/resources/planetlab/scripts/pl-vif-create.py
+++ b/
src/nepi/resources/planetlab/scripts/pl-vif-create.py
@@
-146,9
+146,8
@@
if __name__ == '__main__':
pointopoint = pointopoint, txqueuelen = txqueuelen)
# Saving interface name to vif_name_file
pointopoint = pointopoint, txqueuelen = txqueuelen)
# Saving interface name to vif_name_file
- f = open(vif_name_file, 'w')
- f.write(vif_name)
- f.close()
+ with open(vif_name_file, 'w') as f:
+ f.write(vif_name)
# create unix socket to receive instructions
sock = create_socket(socket_name)
# create unix socket to receive instructions
sock = create_socket(socket_name)