-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
Re-factor the backend implementation #70
Conversation
This is an attempt to get deep_merge's working, which are currently throwing exceptons in my testing environment. See [this issue](voxpupuli#65). I copied the yaml_backend from hiera v1.2.1, which is the one used in puppet v3.4.2, and injected the decryption mechanics. I also needed to copy the `parse_answer` method from the `::Hiera::Backend` and modified it to use the decryption aware version of `parse_string`. It's still an unfortunately long implementation considering that the only real difference between the eyaml backend and the yaml backend is the change to `::Heira::Backend.parse_string` that allows it to process encrypted values. I feel like this backend could be trimmed down so that it inherits from the yaml backend, but the issues with doing that are tricky enough to solve that I'm not going to pursue it at this point.
Should be good to go now. |
Exceptionally quick! |
Thanks @devin-c - this looks good to me and works ok for me (I don't use hashes, but it hasn't broken anything else). My only concern is that the debug has been striped of the hiera-eyaml prefix so it is no longer easy to see the origin of hiera log output. This could be confusing since they are largely the same log lines as those that the standard yaml backend. Can we re-introduce the [hiera-eyaml] prefix to differentiate output from the eyaml backend? |
@sihil, sorry about that. |
The "[hiera-eyaml]" log tag is back in place. |
Thanks. Looks good to me 👍 |
This is an attempt to get deep_merge's working, which are currently
throwing exceptons in my testing environment. See #65.
I copied the yaml_backend from hiera v1.2.1, which is the one used in
puppet v3.4.2, and injected the decryption mechanics. I also needed to
copy the
parse_answer
method from the::Hiera::Backend
and modifiedit to use the decryption aware version of
parse_string
. It's still anunfortunately long implementation considering that the only real
difference between the eyaml backend and the yaml backend is the change
to
::Heira::Backend.parse_string
that allows it to process encryptedvalues.
I feel like this backend could be trimmed down so that it inherits from
the yaml backend, but the issues with doing that are tricky enough to
solve that I'm not going to pursue it at this point.
I've successfully tested this in my sandbox environment at work.