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

Chef search result return as Hash #42

Open
aaronfeng opened this issue Sep 25, 2013 · 5 comments
Open

Chef search result return as Hash #42

aaronfeng opened this issue Sep 25, 2013 · 5 comments

Comments

@aaronfeng
Copy link

Not sure if this is intentional, but I believe normal Chef search returns a different type of object (Hashie Mash I believe). I have several cookbooks that are calling methods that don't exists on Hash but exists on the normal Chef search result object. What's the best way to handle this?

@tobami
Copy link

tobami commented Sep 26, 2013

That is a good question. You notice that when trying to access a value using a symbolic link instead of single quotes: it only works with a Mash.

@aaronfeng
Copy link
Author

There are definitely issues like using the dot notation will also bomb, ie, foo.bar.
Or foo.attribute?(:bar).

@arr-dev
Copy link

arr-dev commented Oct 17, 2013

👍

@michaelglass
Copy link

I don't have a lot of experience with chef-client. Can you give some example queries and their results? (e.g. write some simple tests for this enhancement?)

@e0da
Copy link

e0da commented Apr 26, 2014

It's actually not a Hashie::Mash. It's a Mash, but it's Chef's own ::Mash implementation. I couldn't tell you why they did this. Worse, it doesn't work like a Hashie::Mash. It just has the same name. :rage1: Just a heads up for when you start digging around in there and this gives you headaches.

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

No branches or pull requests

5 participants