mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-28 07:31:23 -07:00
Fix to ensure youngest snapshot is retrieved rather than oldest (#3115)
This commit is contained in:
parent
5b8d209b7e
commit
5a48a2e93e
1 changed files with 1 additions and 1 deletions
|
@ -148,7 +148,7 @@ def _get_most_recent_snapshot(snapshots, max_snapshot_age_secs=None, now=None):
|
||||||
if not now:
|
if not now:
|
||||||
now = datetime.datetime.utcnow()
|
now = datetime.datetime.utcnow()
|
||||||
|
|
||||||
youngest_snapshot = min(snapshots, key=_get_snapshot_starttime)
|
youngest_snapshot = max(snapshots, key=_get_snapshot_starttime)
|
||||||
|
|
||||||
# See if the snapshot is younger that the given max age
|
# See if the snapshot is younger that the given max age
|
||||||
snapshot_start = datetime.datetime.strptime(youngest_snapshot.start_time, '%Y-%m-%dT%H:%M:%S.000Z')
|
snapshot_start = datetime.datetime.strptime(youngest_snapshot.start_time, '%Y-%m-%dT%H:%M:%S.000Z')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue