Add atime and mtime support for files ops, start with files.put #1372
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add concrete support for
atime
andmtime
checking/setting in thefiles.put
operation and provide infrastructure to add this time metadata support to other operations as well.Includes a fix in
facts/piles.py
to accommodate negative timestamps fromstat
on the remote host.Added support for more
os.stat_result
file metadata to be provided in the test json files, by updating the mockos.stat
patch used for testing. This includesatime
,mtime
, but also the other members of the standardstat
10-tuple as well.@Fizzadar: Looking for any feedback/implementation concerns, style changes you'd like, and how best to handle documenting the specifics and caveats. I added a note in the operation docstring, but if
atime
andmtime
support is implemented in other operations (e.g.,files.file
) these will be true there as well. Is there a preferred way to break that information out into something outside of the function-specific docstring?The expanded mock
os.stat
added a fair number of LOC, but it's also now equipped for future features/higher fidelity.Also, I used the American spelling of "normalize" in one of the added support functions, happy to change it to British if preferred.
3.x
at this time)scripts/dev-test.sh
)scripts/dev-lint.sh
)