]> www.vanbest.org Git - motioneye-debian/commitdiff
smb mount point is now removed after umount
authorCalin Crisan <ccrisan@gmail.com>
Sat, 28 Jun 2014 13:00:09 +0000 (16:00 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Sat, 28 Jun 2014 13:00:09 +0000 (16:00 +0300)
src/smbctl.py

index 86ef65093cd4bb8caca74e49d003d390c04f9ea8..64ebcdd816cb01582dc12953aabf98b8b188105a 100644 (file)
@@ -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():