Skip to content

Commit

Permalink
Merge pull request #118 from CybercentreCanada/persistent-service-update
Browse files Browse the repository at this point in the history
inspect size of downloaded update
  • Loading branch information
cccs-rs authored Sep 28, 2021
2 parents 040e84b + 8d444ae commit 30f3a6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assemblyline_v4_service/updater/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ def do_local_update(self) -> None:
output=temp_zip_file, query=f"type:{self.updater_type} AND (status:NOISY OR status:DEPLOYED)")

self.log.debug(f"Downloading update to {temp_zip_file}")
if os.path.exists(temp_zip_file):
self.log.debug(f"Verifying this is a zip file: {zip_ident(temp_zip_file)}")
if os.path.exists(temp_zip_file) and os.path.getsize(temp_zip_file) > 0:
self.log.debug(f"Type of file ({os.path.getsize(temp_zip_file)}B): {zip_ident(temp_zip_file)}")
try:
with ZipFile(temp_zip_file, 'r') as zip_f:
zip_f.extractall(output_directory)
Expand Down

0 comments on commit 30f3a6e

Please sign in to comment.