mirror of https://github.com/CIRCL/lookyloo
fix: Avoid exception on empty dir in archiver.
parent
13256c6166
commit
d0d08b5882
|
@ -81,6 +81,10 @@ class Archiver(AbstractManager):
|
||||||
if not capture_dir.is_dir():
|
if not capture_dir.is_dir():
|
||||||
self.logger.warning(f'{capture_dir} is not a directory')
|
self.logger.warning(f'{capture_dir} is not a directory')
|
||||||
continue
|
continue
|
||||||
|
if not next(capture_dir.iterdir(), None):
|
||||||
|
self.logger.warning(f'{capture_dir} is empty, removing.')
|
||||||
|
capture_dir.rmdir()
|
||||||
|
continue
|
||||||
uuid_file = capture_dir / 'uuid'
|
uuid_file = capture_dir / 'uuid'
|
||||||
if not uuid_file.exists():
|
if not uuid_file.exists():
|
||||||
self.logger.warning(f'No UUID file in {capture_dir}.')
|
self.logger.warning(f'No UUID file in {capture_dir}.')
|
||||||
|
|
Loading…
Reference in New Issue