Skip to content
This repository has been archived by the owner on Apr 18, 2018. It is now read-only.

parse_date does not handle exceptions to date format #15

Open
leighmhart opened this issue Feb 15, 2018 · 0 comments
Open

parse_date does not handle exceptions to date format #15

leighmhart opened this issue Feb 15, 2018 · 0 comments

Comments

@leighmhart
Copy link

leighmhart commented Feb 15, 2018

We have been using the EBS Snapshot Scheduler for quite some time and, at some point, the date format returned by datetime.timedelta has apparently changed as we have started seeing errors in our lambda execution:

time data '2017-07-26 08:03:21' does not match format '%Y-%m-%d %H:%M:%S.%f'

these errors appear to be stopping the code execution at that point in purge_history, rather than handling the error and moving on to other snapshots in that region - as a result, no snapshots are purged.

I think a try/except would help address this issue?

try:
  check_time = parse_date("2017-07-26 08:03:21")
except:
  print "\n\nparse_date: invalid date found in database, skipping\n\n"

or equivalent?

Meanwhile I have to go back and massage entries in my history table data... interestingly, I found only 1 that matched.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant