X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=account.py;fp=account.py;h=4d74a1b8a69778d3e68877405002e93892a2f1e4;hb=1b4f53e648b13f7629970787b6ec03387e2d966a;hp=3631d4d4d0bbb5b05d7d611849dde7497f2d3af5;hpb=9e596e6eb3c871ab25837903b0ed30f165d9d688;p=nodemanager.git diff --git a/account.py b/account.py index 3631d4d..4d74a1b 100644 --- a/account.py +++ b/account.py @@ -155,9 +155,10 @@ class Account: root_ssh = "/home/{}/.ssh".format(slicename) sliver_ssh = "/vservers/{}/home/{}/.ssh".format(slicename, slicename) def is_mounted (root_ssh): - for mount_line in file('/proc/mounts').readlines(): - if mount_line.find (root_ssh) >= 0: - return True + with open('/proc/mounts') as mountsfile: + for mount_line in mountsfile.readlines(): + if mount_line.find (root_ssh) >= 0: + return True return False if do_mount: # any of both might not exist yet