ripienaar/hiera — Issue #22: Proper handling of array hashs
Author: CatDaaaady
Created: 2011-10-18 00:33:45+00:00
State: open

Current we have an array of hashs in our yaml file

```yaml
people:
- name: "Trevor"
id: "101"
- name: "Tim"
id: "202"
```

Using thearray option with hiera it tries to flatten, uniq, compact and sort the data. I believe it goes fine until the sort.

> ./lib/hiera/backend.rb:132:in `sort': undefined method `<=>' for {"name"=>"Trevor", "id"=>"101"}:Hash (NoMethodError)
from ./lib/hiera/backend.rb:132:in `resolve_answer'
from ./lib/hiera/backend.rb:166:in `lookup'
from ./lib/hiera.rb:59:in `lookup'
from bin/hiera:208

I am not sure of the best approach for a fix. I am using ruby 1.8.5. I heard ruby < 1.9 don't support sorting hashs. Using ruby 1.9.2 with hiera seems to have it's own issues though (https://github.com/ripienaar/hiera/issues/19) .

Thoughts?