Give the man a cigar.  As soon as I mocked up "ipaddress" it was happy.
Don't know why I didn't see that....


On Mon, Dec 5, 2016 at 12:43 PM Rob Nelson <rnels...@gmail.com> wrote:

> The error is in the function query_facts, or code that it calls. Puppet is
> not great about reporting on a Ruby code failure called from the puppet DSL.
>
> I couldn't tell you the actual cause but if you look wherever that
> function is defined you may see a collect statement and that should guide
> you. My guess is that some fact it relies on wasn't mocked (well) and is
> returning nil, thus there is no .collect method on nil.
>
> On Mon, Dec 5, 2016 at 5:25 PM Peter Berghold <salty.cowd...@gmail.com>
> wrote:
>
> The piece of Puppet code the spec testing is complaining about is here:
>
> ----------8< snip
> 8<-------------------------------------------------------------------------
>
>   $servers = ntp_unpackservers(
>     query_facts("is_ntp_server=true and sitename =
> ${sitename}",'ipaddress')
>   )
>
> ----------8< snip
> 8<-------------------------------------------------------------------------
>
> and the error I'm seeing is:
>
> ----------8< snip
> 8<-------------------------------------------------------------------------
>
>      Puppet::Error:
>        undefined method `collect' for "ipaddress":String at /home/<my
> account>/puppet-module-src/ntp/spec/fixtures/modules/ntp/manifests/client.pp:8
> on node redacted
>
> ----------8< snip
> 8<-------------------------------------------------------------------------
>
> so the question is what defines "collect?"
>
> The code sniglet is a query of PuppetDB that works well in our test and
> production environments but I'm having issues trying to convince RSpec it's
> working.
>
> Thoughts? Suggestions?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CAArvnv3ivnqNoQk2dFzuD3YYpy4p9YBY_XpCZUgc2wTT4vNsWA%40mail.gmail.com
> <https://groups.google.com/d/msgid/puppet-users/CAArvnv3ivnqNoQk2dFzuD3YYpy4p9YBY_XpCZUgc2wTT4vNsWA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> Rob Nelson
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CAC76iT8F4vS4BTvP5XV%3DO93hY3aFT-fb3wEQ%3DyaJrO3K8BK-bw%40mail.gmail.com
> <https://groups.google.com/d/msgid/puppet-users/CAC76iT8F4vS4BTvP5XV%3DO93hY3aFT-fb3wEQ%3DyaJrO3K8BK-bw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAArvnv3WRpaQn8LK0dWDVZZETc8ax%3D1MZOq%2BfL-VKU6PteKwRA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to