-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
file.managed: Allow local file sources to use source_hash #29289
Conversation
While the diff may not be 100% clear on this, all this PR does is move the check if the file is a local file below where source_hash is evaluated, so that using a sha256 hash is done as a fallback if source_hash is not provided. |
source_sum = {'hsum': file_sum, 'hash_type': 'sha256'} | ||
elif source.startswith('/'): | ||
file_sum = get_hash(source, form='sha256') | ||
source_sum = {'hsum': file_sum, 'hash_type': 'sha256'} | ||
elif source_hash: | ||
protos = ('salt', 'http', 'https', 'ftp', 'swift', 's3') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@terminalmage, can we add 'file'
to this list of accepted source_hash protos? Will that allow us to specify a hash in the form: source_hash: file:///path/to/hashfile.hash
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that would work. If you want to submit the PR, go ahead, otherwise I can do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I'm on it.
Makes sense. Cool. |
file.managed: Allow local file sources to use source_hash
Maybe a slight tangent, but I think this mesage is not quite right when the |
Oops, already merged. Shucks. |
@lorengordon Can you send over a PR with those changes? I'd love to include them. |
@cachedout, yep, see #29305. |
@lorengordon Thank you very much. |
@lorengordon Thanks! |
Fixes #26526.