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 file.py to allow user to touch file with Unix date of birth #58480

Closed
wants to merge 2 commits into from

Conversation

importepeu
Copy link
Contributor

@importepeu importepeu commented Sep 17, 2020

Allow user to use Unix date of birth

What does this PR do?

Change file.touch management to allow users to specify atime or mtime values of '0' to touch file with Unix epoch time 1970-01-01 01:00:00.000000000. It was done previously for 2018.3 with PR #49310

What issues does this PR fix or reference?

Fixes:

Previous Behavior

Setting atime or mtime with "0" touched the file with current timestamp instead of Unix date of birth.

New Behavior

Now users can set atime or mtime values to '0' to get Unix date of birth, set them to other positive values or unset them to touch file with current time.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

Allow user to use Unix birth of time
@importepeu importepeu requested a review from a team as a code owner September 17, 2020 12:20
@ghost ghost requested review from krionbsd and removed request for a team September 17, 2020 12:20
@importepeu importepeu changed the title Update file.py Update file.py to allow user to touch file with Unix date of birth Sep 17, 2020
@krionbsd
Copy link
Contributor

@importepeu thank you for contribution, could you please run pre-commit on your changes and re-submit the patch, you might remove unused import io from file.py as well.

Another thing to mention is to add the test cases for this change, you might take a look at:

tests/unit/states/test_file.py
tests/integration/states/test_file.py

@krionbsd krionbsd added Needs-Testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases Test-Failure Fix the CI failure ⛈ labels Sep 17, 2020
@dwoz
Copy link
Contributor

dwoz commented Dec 10, 2023

Closing this due to inactivity. Anyone should feel free to re-open it if they want to see it through to the end in one release cycle.

@dwoz dwoz closed this Dec 10, 2023
@dwoz dwoz added Abandoned help-wanted Community help is needed to resolve this labels Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Abandoned help-wanted Community help is needed to resolve this Needs-Testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases Test-Failure Fix the CI failure ⛈
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants