Skip to content

Commit

Permalink
fix for #28
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-gangl committed Nov 15, 2021
1 parent c8c178d commit 481c3da
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion subscriber/podaac_data_subscriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ def run():
'Specify an output directory or '
'choose another output directory flag other than -dc.') # noqa E501


timestamp = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ")

# Neatly print the first granule record (if one was returned):
Expand Down Expand Up @@ -429,8 +430,18 @@ def prepare_time_output(times, prefix, file):
write_path
string path to where granules will be written
"""

time_match = [dt for dt in
times if dt[0] == splitext(basename(file))[0]][0][1]
times if dt[0] == splitext(basename(file))[0]]

# Found on 11/11/21
# https://github.com/podaac/data-subscriber/issues/28
# if we don't find the time match array, try again using the
# filename AND its suffix (above removes it...)
if len(time_match) == 0:
time_match = [dt for dt in
times if dt[0] == basename(file)]
time_match = time_match[0][1]

# offset timestamp for output paths
if args.offset:
Expand Down

0 comments on commit 481c3da

Please sign in to comment.