Uploaded image for project: 'Facter'
  1. Facter
  2. FACT-1050

can't find facts specified on CLI when defined in ini file containing spaces around =

    XMLWordPrintable

Details

    • Bug
    • Status: Accepted
    • Normal
    • Resolution: Unresolved
    • None
    • None
    • Facter 3, Facter 4
    • Platform OS

    Description

      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
      

      native facter:

      [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
      

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              erict Eric Thompson
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:

                Zendesk Support