stdlib::parsehocon: Support reading files#1436
Open
bastelfreak wants to merge 2 commits intopuppetlabs:mainfrom
Open
stdlib::parsehocon: Support reading files#1436bastelfreak wants to merge 2 commits intopuppetlabs:mainfrom
bastelfreak wants to merge 2 commits intopuppetlabs:mainfrom
Conversation
ekohl
requested changes
Aug 9, 2024
| require 'hocon/config_factory' | ||
|
|
||
| begin | ||
| if File.exist? hocon_string |
Collaborator
There was a problem hiding this comment.
I'm not a fan of this, because this can also run on the server. It becomes unpredictable.
Isn't there a way to read a file in puppet? I know file() can be used in some cases. Its docs mention it can also read absolute files, so I'd expect this to work:
stdlib::parsehocon(file('/path/to/file'))
Collaborator
Author
There was a problem hiding this comment.
yes the idea was to read a file from a PE installation on the puppetserver. Your solution should work. I think I will propose this function to the hocon module in case that's still maintained.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This makes it possible to also parse hocon files. I'm a bit unsure if we should extend the current function or add a new load like
stdlib::loadhocon. I'm fine with both. Let me know what you prefer and I will add some tests for it.Additional Context
Add any additional context about the problem here.
Related Issues (if any)
Mention any related issues or pull requests.
Checklist
puppet apply)