Skip to content

Comments

facts.apt.update: fix computation of cache_time when host is not UTC#1504

Merged
Fizzadar merged 1 commit intopyinfra-dev:3.xfrom
philippemilink:fix-apt-update-cache-with-timezone
Dec 2, 2025
Merged

facts.apt.update: fix computation of cache_time when host is not UTC#1504
Fizzadar merged 1 commit intopyinfra-dev:3.xfrom
philippemilink:fix-apt-update-cache-with-timezone

Conversation

@philippemilink
Copy link
Contributor

@philippemilink philippemilink commented Nov 29, 2025

And reorganize a bit the logic to gather the Date fact only if required.

The timezone of my hosts are set on UTC+1. I noticed that the operation apt.update was always executed, even when the cache_time parameter was supposed to make it a noop. See the comment in the code for an explanation of the problem.

  • Pull request is based on the default branch (3.x at this time)
  • Pull request includes tests for any new/updated operations/facts
  • Pull request includes documentation for any new/updated operations/facts => not applicable
  • Tests pass (see scripts/dev-test.sh) => let's see the result of the CI
  • Type checking & code style passes (see scripts/dev-lint.sh)

@philippemilink philippemilink force-pushed the fix-apt-update-cache-with-timezone branch 2 times, most recently from 0b1a93a to e50913f Compare November 29, 2025 19:41
And reorganize a bit the logic to gather the Date fact only if required.
@philippemilink philippemilink force-pushed the fix-apt-update-cache-with-timezone branch from e50913f to ed470cb Compare November 29, 2025 19:50
Copy link
Member

@Fizzadar Fizzadar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR, @philippemilink! Nice fix and a test too 👌

@Fizzadar Fizzadar merged commit 775c2f3 into pyinfra-dev:3.x Dec 2, 2025
25 checks passed
@philippemilink philippemilink deleted the fix-apt-update-cache-with-timezone branch December 2, 2025 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants