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

ENC script doesn't cover all cases for returned values as defined by Puppet ENC docs #1

Open
Misho-98118 opened this issue Jul 30, 2019 · 0 comments

Comments

@Misho-98118
Copy link

Puppet Docs for ENC defines the format of returned result as hash with mandatory key either "classes" or "parameters" or both. "environment" key is optional.
Current implementation of d42 ENC script always returns "classes" and there is no way to omit it, even if key "parameters" is presented. If "classes" doesn't exist (omitted) in the input JSON (under d42 "custom fields"), function top_level_classes_reducer fails on line 64, because it indexes directly key ['classes'], which doesn't exist.
If "classes" key is defined as "null" (I don't want to provide classes via ENC; I want to provide only "parameters"), the return format changes - "classes" becomes a global key and "parameters" and "environment" are under its scope (they look like classes names), which is not correct. "classes", "parameters" and "environment" keys have to be on same hierarchy level according to puppet docs.

Expected behavior: return format has to comply to ENC description in Puppet docs. Script has to be able to work with input of either "classes" or "parameters" or both.

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

No branches or pull requests

1 participant