dalen / puppet-puppetdbquery

Query functions for PuppetDB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there a way to "sort by" in query_nodes function?

apazga opened this issue · comments

Hi,

First, thanks for the development of this module, it's really useful.
Then a question more than an issue:

Is there any way to "sort by" the output of the functions like query_nodes? e.g.:

$special_nodes = query_nodes('hostgroup=special')
# being hostgroup a custom fact that labels some type of nodes

$special nodes will have a list of non-sorted by name nodes, and I would like to sort them alfabetically by their names.

Thanks in advance.

I finally used enclosed my output in a call to sort function from stdlib and it's done, so I'll close the issue.
If anyone need this functionality directly from the puppetdbquery output, re-issue it again if you want.