Skip to content

Commit

Permalink
fixed datestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
davedavemckay committed Jul 1, 2024
1 parent 38b5974 commit e5afa5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion echo-side/dags/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
task_id='compare_csv_file_lists',
image='ghcr.io/lsst-uk/csd3-echo-somerville:latest',
cmds=['./entrypoint.sh'],
arguments=['python', 'csd3-echo-somerville/scripts/compare_csv_file_lists.py', '--path', '/lsst-backup-logs'],
arguments=['python', 'csd3-echo-somerville/scripts/compare_csv_file_lists.py', '--path', '/lsst-backup-logs', '--datestamp', '{{ ds_nodash }}'],
dag=dag,
volumes=[logs_volume],
volume_mounts=[logs_volume_mount],
Expand Down
7 changes: 4 additions & 3 deletions scripts/compare_csv_file_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@

parser = argparse.ArgumentParser(description="Compare CSV file lists in a log folder.")
parser.add_argument("--path", '-p', help="Path to the log folder", required=True)
parser.add_argument("--datestamp", '-d', help="Datestamp", required=True, help="Datestamp in the form YYYYMMDD")
args = parser.parse_args()

log_folder = args.path
datestamp = args.datestamp

def compare_csv_file_lists(log_folder):
def compare_csv_file_lists(log_folder, ds):
"""
Compare the CSV file lists in the specified log folder.
Expand All @@ -19,7 +21,6 @@ def compare_csv_file_lists(log_folder):
"""
csv_files = []
for filename in os.listdir(log_folder):
ds = '{{ ds_nodash }}'
print(filename,ds)
if filename.startswith("lsst-backup-logs-"):
if filename.endswith(".csv"):
Expand All @@ -31,4 +32,4 @@ def compare_csv_file_lists(log_folder):
print(csv_files)

if __name__ == "__main__":
compare_csv_file_lists(log_folder)
compare_csv_file_lists(log_folder, datestamp)

0 comments on commit e5afa5f

Please sign in to comment.