io_loop.add_timeout(datetime.timedelta(seconds=2), later)
else:
- logging.info('invalidating config cache')
invalidate()
return {'reboot': settings.ENABLE_REBOOT}
camera_ids = config.get_camera_ids()
for camera_id in camera_ids:
camera_config = config.get_camera(camera_id)
- if not os.path.exists(camera_config['target_dir']):
- try:
- os.makedirs(camera_config['target_dir'])
-
- except Exception as e:
- logging.error('failed to create root media folder "%s" for camera with id %s: %s' % (
- camera_config['target_dir'], camera_id, e))
+ if 'target_dir' in camera_config:
+ if not os.path.exists(camera_config['target_dir']):
+ try:
+ os.makedirs(camera_config['target_dir'])
+
+ except Exception as e:
+ logging.error('failed to create root media folder "%s" for camera with id %s: %s' % (
+ camera_config['target_dir'], camera_id, e))
def start_motion():