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

Re-factor the backend implementation #70

Merged
merged 2 commits into from
Mar 7, 2014

Conversation

quixoten
Copy link
Contributor

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 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.

I've successfully tested this in my sandbox environment at work.

@sihil
Copy link
Collaborator

sihil commented Feb 19, 2014

Hi @devin-c - can you please merge in from master and re-push this branch. I've fixed the problem with the build - see discussion on #73.

Hopefully we'll get around to reviewing your pull request later this week.

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.
@quixoten
Copy link
Contributor Author

Should be good to go now.

@sihil
Copy link
Collaborator

sihil commented Feb 19, 2014

Exceptionally quick!

@sihil
Copy link
Collaborator

sihil commented Mar 3, 2014

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?

@quixoten
Copy link
Contributor Author

quixoten commented Mar 3, 2014

@sihil, sorry about that.

@quixoten
Copy link
Contributor Author

quixoten commented Mar 3, 2014

The "[hiera-eyaml]" log tag is back in place.

@sihil
Copy link
Collaborator

sihil commented Mar 3, 2014

Thanks. Looks good to me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants