From 4e2960c4a8e3959fce9be21c5206fd0265eeb336 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sat, 28 Jun 2014 16:00:09 +0300 Subject: [PATCH] smb mount point is now removed after umount --- src/smbctl.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/smbctl.py b/src/smbctl.py index 86ef650..64ebcdd 100644 --- a/src/smbctl.py +++ b/src/smbctl.py @@ -150,13 +150,21 @@ def umount(server, share, username): try: subprocess.check_call('umount %s' % mount_point, shell=True) - - return True except subprocess.CalledProcessError: logging.error('failed to unmount smb share "//%s/%s" from "%s"' % (server, share, mount_point)) return False + + try: + os.remove(mount_point) + + except Exception as e: + logging.error('failed to remove smb mount point "%s": %s' % (mount_point, e)) + + return False + + return True def update_mounts(): -- 2.39.5