Jira (FACT-1050) can't find facts specified on CLI when defined in ini file containing spaces around =

4 views
Skip to first unread message

Eric Thompson (JIRA)

unread,
Jun 17, 2015, 6:14:13 PM6/17/15
to puppe...@googlegroups.com
Eric Thompson created an issue
 
Facter / Bug FACT-1050
can't find facts specified on CLI when defined in ini file containing spaces around =
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2015/06/17 3:14 PM
Priority: Normal Normal
Reporter: Eric Thompson

i've seen this in both native and ruby facter.
if you define an external non-executable fact containing a space in an ini txt file, and there are spaces around the '=' the fact key appears to have a trailing space in it.
In facter2, IIRC you can get the fact using 'foo ', but this doesn't appear to work in native facter. In either case you can find the fact in the entire output with grep.
./external/foo.txt

foo = bar
bar=foo

[root@lks2ze2y006q9pk ~]# facter --external-dir external/ foo
 
[root@lks2ze2y006q9pk ~]# facter --external-dir external/ 'foo '
 
[root@lks2ze2y006q9pk ~]# facter --external-dir external/ | grep foo
bar => foo
foo  =>  bar
[root@lks2ze2y006q9pk ~]# facter --external-dir external/ bar
foo
[root@lks2ze2y006q9pk ~]# facter --external-dir external/ 'bar'
foo
[root@lks2ze2y006q9pk ~]# facter --external-dir external/ 'bar '
foo

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.3.15#6346-sha1:dbc023d)
Atlassian logo

Eric Thompson (JIRA)

unread,
Jun 17, 2015, 6:16:56 PM6/17/15
to puppe...@googlegroups.com
Eric Thompson updated an issue
Change By: Eric Thompson
i've seen this in both native and ruby facter.
if you define an external non-executable fact containing a space in an ini txt file, and there are spaces around the '=' the fact key appears to have a trailing space in it.
In facter2, IIRC you can get the fact using 'foo ', but this doesn't appear to work in native facter.  In either case you can find the fact in the entire output with grep.
./external/foo.txt
{code}
foo = bar
bar=foo
{code}

{code}

[root@lks2ze2y006q9pk ~]# facter --external-dir external/ foo

[root@lks2ze2y006q9pk ~]# facter --external-dir external/ 'foo '

[root@lks2ze2y006q9pk ~]# facter --external-dir external/ | grep foo
bar => foo
foo  =>  bar
[root@lks2ze2y006q9pk ~]# facter --external-dir external/ bar
foo
[root@lks2ze2y006q9pk ~]# facter --external-dir external/ 'bar'
foo
[root@lks2ze2y006q9pk ~]# facter --external-dir external/ 'bar '
foo
{code}

it appears native facter is stripping the spaces off the key on the CLI, but not in the inifile
it appears facter 2 is doing neither.

Eric Thompson (JIRA)

unread,
Jun 17, 2015, 6:17:57 PM6/17/15
to puppe...@googlegroups.com
Eric Thompson updated an issue
i've seen this in both native and ruby facter.
if you define an external non-executable fact containing a space in an ini txt file, and there are spaces around the '=' the fact key appears to have a trailing space in it.
In facter2, IIRC you can get the fact using 'foo ', but this doesn't appear to work in native facter.  In either case you can find the fact in the entire output with grep.
./external/foo.txt
{code}
foo = bar
bar=foo
{code}

native facter:
{code}
[root@lks2ze2y006q9pk ~]# facter --external-dir external/ foo

[root@lks2ze2y006q9pk ~]# facter --external-dir external/ 'foo '

[root@lks2ze2y006q9pk ~]# facter --external-dir external/ | grep foo
bar => foo
foo  =>  bar
[root@lks2ze2y006q9pk ~]# facter --external-dir external/ bar
foo
[root@lks2ze2y006q9pk ~]# facter --external-dir external/ 'bar'
foo
[root@lks2ze2y006q9pk ~]# facter --external-dir external/ 'bar '
foo
{code}

it appears native facter is stripping the spaces off the key on the CLI, but not in the inifile
it appears facter 2 is doing neither.

Kylo Ginsberg (JIRA)

unread,
Sep 10, 2015, 1:27:02 PM9/10/15
to puppe...@googlegroups.com
Kylo Ginsberg commented on Bug FACT-1050
 
Re: can't find facts specified on CLI when defined in ini file containing spaces around =

Fwiw, the CLI behavior in facter 3 is not specific to external facts.

This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4)
Atlassian logo

Josh Cooper (JIRA)

unread,
Dec 10, 2015, 12:23:27 PM12/10/15
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
Labels: puppethack
This message was sent by Atlassian JIRA (v6.4.12#64027-sha1:e3691cc)
Atlassian logo

Josh Cooper (JIRA)

unread,
Dec 10, 2015, 12:27:27 PM12/10/15
to puppe...@googlegroups.com

Sean McDonald (JIRA)

unread,
May 17, 2017, 1:30:09 PM5/17/17
to puppe...@googlegroups.com
Sean McDonald updated an issue
 
Change By: Sean McDonald
Team: Agent
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Maggie Dreyer (JIRA)

unread,
May 17, 2017, 1:30:18 PM5/17/17
to puppe...@googlegroups.com

Moses Mendoza (JIRA)

unread,
May 18, 2017, 1:49:37 PM5/18/17
to puppe...@googlegroups.com

Branan Riley (JIRA)

unread,
Mar 21, 2018, 5:57:03 PM3/21/18
to puppe...@googlegroups.com
Branan Riley updated an issue
Change By: Branan Riley
Labels: Easy puppethack triaged
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Josh Cooper (Jira)

unread,
Apr 21, 2022, 3:32:03 PM4/21/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Component/s: Facter 4
Component/s: Facter 3
This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo

Josh Cooper (Jira)

unread,
Apr 21, 2022, 3:32:03 PM4/21/22
to puppe...@googlegroups.com
Josh Cooper commented on Bug FACT-1050
 
Re: can't find facts specified on CLI when defined in ini file containing spaces around =

Facter 3 and 4 are consistent:

# cat external/foo.txt 
foo = bar
# /opt/puppetlabs/puppet/bin/facter --version
3.14.23 (commit 46e6e6ffdecff72b75853af43a11acdf2d36752c)
# # /opt/puppetlabs/puppet/bin/facter --external-dir external/ foo
 
# /opt/puppetlabs/puppet/bin/facter --external-dir external/ | grep foo
foo  =>  bar
# /opt/puppetlabs/puppet/bin/facter-ng --version
4.2.8
# /opt/puppetlabs/puppet/bin/facter-ng --external-dir external/ foo
 
# /opt/puppetlabs/puppet/bin/facter-ng --external-dir external/ | grep foo
foo  =>  bar

 

Reply all
Reply to author
Forward
0 new messages