Jira (FACT-2553) Backslashes are handled differently in facter-ng

9 views
Skip to first unread message

Josh Cooper (Jira)

unread,
Apr 14, 2020, 1:17:04 PM4/14/20
to puppe...@googlegroups.com
Josh Cooper created an issue
 
Facter / Bug FACT-2553
Backslashes are handled differently in facter-ng
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2020/04/14 10:16 AM
Priority: Normal Normal
Reporter: Josh Cooper

I see two differences when comparing facter and facter-ng output on Windows 2019. The aio_agent_version and puppetversion facts are missing.

Also paths with backslashes often are escaped on facter-ng, but not facter:

1d0
< aio_agent_version => 6.14.0.237
10,11c9,10
< env_windows_installdir => C:\Program Files\Puppet Labs\Puppet
< facterversion => 3.14.10
---
> env_windows_installdir => C:\\Program Files\\Puppet Labs\\Puppet
> facterversion => 4.0.15
14c13,14
<   vmware => {}
---
>   vmware => {
>   }
18c18
<   user => "STIFFER-EXHAUST\Administrator"
---
>   user => "STIFFER-EXHAUST\\Administrator"
27,29c27,29
<     available => "2.91 GiB",
<     available_bytes => 3129040896,
<     capacity => "27.13%",
---
>     available => "2.90 GiB",
>     available_bytes => 3118993408,
>     capacity => "27.36%",
32,33c32,33
<     used => "1.08 GiB",
<     used_bytes => 1164857344
---
>     used => "1.09 GiB",
>     used_bytes => 1174904832
94c94
<     system32 => "C:\Windows\system32"
---
>     system32 => "C:\\Windows\\system32"
97c97
< path => C:\Program Files\Puppet Labs\Puppet\puppet\bin;C:\Program Files\Puppet Labs\Puppet\bin;C:\cygwin64\usr\local\bin;C:\cygwin64\bin;C:\cygwin64\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Packer\SysInternals;C:\Program Files\Git\cmd;C:\Program Files\PowerShell\6;C:\Users\cyg_server\AppData\Local\Microsoft\WindowsApps
---
> path => C:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\cygwin64\\usr\\local\\bin;C:\\cygwin64\\bin;C:\\cygwin64\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0;C:\\Windows\\System32\\OpenSSH;C:\\Packer\\SysInternals;C:\\Program Files\\Git\\cmd;C:\\Program Files\\PowerShell\\6;C:\\Users\\cyg_server\\AppData\\Local\\Microsoft\\WindowsApps
106a107
> puppetversion => 6.15.0
115,116c116,117
<   seconds => 1376,
<   uptime => "0:22 hours"
---
>   seconds => 1381,
>   uptime => "0:23 hours"
 

Also when looking at the different output formats, single vs double backslashes is only consistent for json but not yaml or the default:

$ cmd /c facter-ng | grep path
path => C:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\cygwin64\\usr\\local\\bin;C:\\cygwin64\\bin;C:\\cygwin64\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0;C:\\Windows\\System32\\OpenSSH;C:\\Packer\\SysInternals;C:\\Program Files\\Git\\cmd;C:\\Program Files\\PowerShell\\6;C:\\Users\\cyg_server\\AppData\\Local\\Microsoft\\WindowsApps
 
$ cmd /c facter | grep path
path => C:\Program Files\Puppet Labs\Puppet\puppet\bin;C:\Program Files\Puppet Labs\Puppet\bin;C:\cygwin64\usr\local\bin;C:\cygwin64\bin;C:\cygwin64\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Packer\SysInternals;C:\Program Files\Git\cmd;C:\Program Files\PowerShell\6;C:\Users\cyg_server\AppData\Local\Microsoft\WindowsApps
 
$ cmd /c facter-ng --json | grep path
  "path": "C:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\cygwin64\\usr\\local\\bin;C:\\cygwin64\\bin;C:\\cygwin64\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0;C:\\Windows\\System32\\OpenSSH;C:\\Packer\\SysInternals;C:\\Program Files\\Git\\cmd;C:\\Program Files\\PowerShell\\6;C:\\Users\\cyg_server\\AppData\\Local\\Microsoft\\WindowsApps",
 
$ cmd /c facter --json | grep path
  "path": "C:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\cygwin64\\usr\\local\\bin;C:\\cygwin64\\bin;C:\\cygwin64\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0;C:\\Windows\\System32\\OpenSSH;C:\\Packer\\SysInternals;C:\\Program Files\\Git\\cmd;C:\\Program Files\\PowerShell\\6;C:\\Users\\cyg_server\\AppData\\Local\\Microsoft\\WindowsApps",
 
$ cmd /c facter-ng --yaml | grep path
path: C:\Program Files\Puppet Labs\Puppet\puppet\bin;C:\Program Files\Puppet Labs\Puppet\bin;C:\cygwin64\usr\local\bin;C:\cygwin64\bin;C:\cygwin64\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Packer\SysInternals;C:\Program
 
$ cmd /c facter --yaml | grep path
path: "C:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\cygwin64\\usr\\local\\bin;C:\\cygwin64\\bin;C:\\cygwin64\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0;C:\\Windows\\System32\\OpenSSH;C:\\Packer\\SysInternals;C:\\Program Files\\Git\\cmd;C:\\Program Files\\PowerShell\\6;C:\\Users\\cyg_server\\AppData\\Local\\Microsoft\\WindowsApps"

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Mihai Buzgau (Jira)

unread,
Apr 15, 2020, 2:09:03 AM4/15/20
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Apr 15, 2020, 2:09:03 AM4/15/20
to puppe...@googlegroups.com

Oana Tanasoiu (Jira)

unread,
Apr 15, 2020, 2:58:03 AM4/15/20
to puppe...@googlegroups.com

Oana Tanasoiu (Jira)

unread,
Apr 16, 2020, 7:15:03 AM4/16/20
to puppe...@googlegroups.com
Oana Tanasoiu commented on Bug FACT-2553
 
Re: Backslashes are handled differently in facter-ng

Hi Josh,

I opened a PR for yaml and default output discrepancies.

aio_agent_version fact is not implemented yet and will be added in the near future. https://tickets.puppetlabs.com/browse/FACT-2563

For puppetversion fact is a difference because it is present on Facter 4 by default and in Facter 3 is displayed only when running

facter -p

In Facter 4 the above command option is not supported yet. https://tickets.puppetlabs.com/browse/FACT-2403

Glenn Sarti (Jira)

unread,
Apr 16, 2020, 8:50:03 AM4/16/20
to puppe...@googlegroups.com
Glenn Sarti commented on Bug FACT-2553

Ah, just remember that UNC paths are double backslashed e.g.

 

\\Server\Path

 

So a double backslash isn't always wrong.

Josh Cooper (Jira)

unread,
May 8, 2020, 1:47:03 PM5/8/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug FACT-2553

Looks good, thanks Oana Tanasoiu

C:\ProgramData\PuppetLabs\facter\facts.d>facter unc
\\server\host\share
 
C:\ProgramData\PuppetLabs\facter\facts.d>facter-ng unc
\\server\host\share

Reply all
Reply to author
Forward
0 new messages