ansible/test
Sam Doran 719c40bfdf
[stable-2.10] facts - fix incorrect time for some date_time_facts (#70665) (#70996)
* [stable-2.10] facts - fix incorrect time for some date_time_facts (#70665)

The iso8601_micro and iso8601 facts incorrectly called now.utcnow(), resulting
in a new timestamp at the time it was called, not a conversion of the previously
stored timestamp.

Correct this by capturing the UTC timestamp once then calculating the local
time using the UTC offset of the current system.

* Use time.time() for getting the current time
* Convert from that stored epoch timestamp to local and UTC times
* Used existing timestamp for epoch time
* Add unit tests that validate the formate of the return value rather than an exact value since mocking time and timezone is non-trivial
(cherry picked from commit c4f442ed5a)

Co-authored-by: Sam Doran <sdoran@redhat.com>

* Remove tests for tz_dst since that only exists in newer versions
2020-07-30 13:37:19 -07:00
..
ansible_test
integration Fix warning for new default permissions when mode is not specified (#70976) (#70985) 2020-07-30 10:10:23 -07:00
lib/ansible_test [stable-2.10] Fix ansible-test relative import analysis. (#70993) 2020-07-30 13:36:49 -07:00
sanity [backport][2.10][PR #70446] Refactor Python API examples and docs (#70850) 2020-07-29 13:51:21 -07:00
support Deprecation revisited (#69926) 2020-06-09 15:21:19 -07:00
units [stable-2.10] facts - fix incorrect time for some date_time_facts (#70665) (#70996) 2020-07-30 13:37:19 -07:00
utils/shippable Remove temporary migration hack from CI scripts. 2020-06-16 11:25:39 -07:00