Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update complex_data_manipulation example uptime in days/h/m/s #77019

Merged
merged 2 commits into from
Feb 14, 2022

Conversation

fbourqui
Copy link

SUMMARY

Timedelta {{ now() - now().fromtimestamp(now(fmt='%s') | int - ansible_uptime_seconds) }}

Example gives uptime with microsecond precision with an original value in seconds: ansible_uptime_seconds

"msg": [                                                                                                                                                                                                                                                                
    "Timedelta 15 days, 3:42:40.680283"                                                                                                                                      
]   

those microseconds are comming from {{ now() - now().fromtimestamp(now(fmt='%s') | int ) }}

Timedelta {{ now().replace(microsecond=0) - now().fromtimestamp(now(fmt='%s') | int - ansible_uptime_seconds) }}
With the change, you will get:

"msg": [                                                                                                                                                                                                                                                                
    "Timedelta 15 days, 3:42:40"                                                                                                                                      
]   
ISSUE TYPE
  • Docs Pull Request

@ansibot ansibot added affects_2.13 core_review In order to be merged, this PR must follow the core review workflow. docs This issue/PR relates to or includes documentation. docs_only All changes are to files within the docs/docsite/ directory needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Feb 12, 2022
@fbourqui
Copy link
Author

replacement of #77009

@Akasurde Akasurde removed the needs_triage Needs a first human triage before being processed. label Feb 14, 2022
@samccann
Copy link
Contributor

Thanks @fbourqui for your patience on this one, especially as I'm asking for changes that weren't really part of your original PR.

@ansibot ansibot added needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. core_review In order to be merged, this PR must follow the core review workflow. and removed core_review In order to be merged, this PR must follow the core review workflow. needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Feb 14, 2022
@samccann samccann merged commit 1480503 into ansible:devel Feb 14, 2022
@samccann
Copy link
Contributor

Thanks @fbourqui for the Ansible docs fix! We talk about Ansible documentation on maxtrix at #docs:ansible.im and on libera IRC at #ansible-docs if you ever want to join us and chat about the docs!

@ansible ansible locked and limited conversation to collaborators Feb 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.13 core_review In order to be merged, this PR must follow the core review workflow. docs_only All changes are to files within the docs/docsite/ directory docs This issue/PR relates to or includes documentation. new_contributor This PR is the first contribution by a new community member. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants