Skip to content

Commit

Permalink
Updater: Use basic iso format for directory names (No : characters)
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-douglass committed Apr 8, 2020
1 parent 4258302 commit 9821191
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion assemblyline_core/updater/run_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,13 @@ def do_file_update(self, service, previous_hash, previous_update):
# Erase the results meta file
os.unlink(results_meta_file)

# Get a timestamp for now, and switch it to basic format representation of time
# Still valid iso 8601, and : is sometimes a restricted character
timestamp = now_as_iso().replace(":", "")

# FILE_UPDATE_DIRECTORY/{service_name} is the directory mounted to the service,
# the service sees multiple directories in that directory, each with a timestamp
destination_dir = os.path.join(service_dir, service.name + '_' + now_as_iso())
destination_dir = os.path.join(service_dir, service.name + '_' + timestamp)
shutil.move(output_directory, destination_dir)

# Remove older update files, due to the naming scheme, older ones will sort first lexically
Expand Down

0 comments on commit 9821191

Please sign in to comment.