]> www.vanbest.org Git - motioneye-debian/commitdiff
smb mounts fixes
authorCalin Crisan <ccrisan@gmail.com>
Sat, 5 Jul 2014 17:56:05 +0000 (20:56 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Sat, 5 Jul 2014 17:56:05 +0000 (20:56 +0300)
motioneye.py
src/config.py
src/smbctl.py
static/js/main.js

index c6d2a1ecd01770b13cfb68386f5bddb6b063976d..0b1327000a61ed1b5bee5d2114c9648db48531d5 100755 (executable)
@@ -29,8 +29,6 @@ import settings
 
 sys.path.append(os.path.join(getattr(settings, 'PROJECT_PATH', os.path.dirname(sys.argv[0])), 'src'))
 
-import smbctl
-
 VERSION = '0.12'
 
 
@@ -326,6 +324,8 @@ def _start_thumbnailer():
 if __name__ == '__main__':
     cmd = _configure_settings()
     
+    import smbctl
+
     if not _test_requirements():
         sys.exit(-1)
     
index ecfedc0bf9fb1388c7ea369ee82cbb310ec78595..fd379fb7a5ac91a07f775a63e13ff838862048b2 100644 (file)
@@ -201,7 +201,7 @@ def get_network_shares():
     
     mounts = []
     for camera in cameras:
-        if camera['@storage_device'] != 'network-share':
+        if camera.get('@storage_device') != 'network-share':
             continue
         
         mounts.append({
@@ -338,14 +338,6 @@ def set_camera(camera_id, camera_config):
         
         set_main(main_config)
         
-        # try to create the target_dir
-        try:
-            os.makedirs(camera_config['target_dir'])
-        
-        except OSError as e:
-            if e.errno != errno.EEXIST:
-                logging.warn('failed to create target directory: %(msg)s' % {'msg': unicode(e)})
-
     # read the actual configuration from file
     config_file_path = os.path.join(settings.CONF_PATH, _CAMERA_CONFIG_FILE_NAME) % {'id': camera_id}
     if os.path.isfile(config_file_path):
index 43a978745862a1fd5330cbb33c9ac4df8638e2d7..8c1f7292354fac0bc2bc961b038a15164e737c65 100644 (file)
@@ -187,9 +187,9 @@ def update_mounts():
                 should_start = False
     
     # unmount the no longer necessary mounts
-    for (network_share['server'], network_share['share'], network_share['username']), required in mounts.items():
+    for (server, share, username), required in mounts.items():
         if not required:
-            umount(network_share['server'], network_share['share'], network_share['username'])
+            umount(server, share, username)
             should_stop = True
     
     return (should_stop, should_start)
index d94a8d62ec76be19b58865eb46bfd4b05a095f85..9dd29cbcf0b99b86cd1eb958ae67117efbe4c3c9 100644 (file)
@@ -727,7 +727,7 @@ function dict2CameraUi(dict) {
     /* file storage */
     $('#storageDeviceSelect').empty();
     dict['available_disks'] = dict['available_disks'] || [];
-    var storageDeviceOptions = {};
+    var storageDeviceOptions = {'network-share': true};
     dict['available_disks'].forEach(function (disk) {
         disk.partitions.forEach(function (partition) {
             var target = partition.target.replaceAll('/', '-');