Custom fact displays with brackets and double quotes, eg ["<fact value>"]

40 views
Skip to first unread message

Ryan Anderson

unread,
Apr 30, 2014, 1:28:30 PM4/30/14
to puppet...@googlegroups.com
I have a ruby custom fact that when queried with 'facter -p mysite' displays as expected (eg TX), but if I do 'facter -p | grep mysite' it shows up like ["MN"]. It will show up this wrong way when it goes to puppetdb (whose data I view with puppetboard).

This custom fact only behaves this way on one platform, AIX with ruby 2.0.0p353. The built-in facts do not have this same issue. Any ideas on how to fix this? The ruby fact code is something like:

Facter.add("mysite") do
    setcode do
        case Facter.value(:ipaddress)
            when /^10\.1\.91\.|^10\.1\.92\.|^10\.1\.93\./
                "TX"
            when /^13\.1\.1\.|^13\.1\.2\./
                "CA"
        end
    end
end

Felix Frank

unread,
May 5, 2014, 8:19:07 AM5/5/14
to puppet...@googlegroups.com
Hi,

is this machine also running a different facter version?

You may wish to report this as a bug at https://tickets.puppetlabs.com/

Thanks,
Felix

Ryan Anderson

unread,
May 5, 2014, 10:35:17 AM5/5/14
to puppet...@googlegroups.com
Oops, I should have been more specific. All AIX versions exhibit this behavior and all are consistently running facter 1.7.5 and puppet open source 3.4.3; both are installed via ruby gem.
Reply all
Reply to author
Forward
0 new messages