Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
None
-
Night's Watch
-
2
-
NW - 2021-08-25
-
Needs Assessment
-
45161
-
1
-
Bug Fix
-
Fixed faulty regex on AIX that would result in an `odd number of arguments` error when resolving mountpoint facts
-
Needs Assessment
Description
After agent upgrade to puppet-agent-7.8.0-1.aix7.1.ppc.rpm with facter 4.2, facter is producing "odd number of arguments for Hash" errors. This was not the case when using facter 3.14
The issue is caused by https://github.com/puppetlabs/facter/blob/main/lib/facter/util/aix/info_extractor.rb#L14 which makes the assumption that keys are sparated by multiple spaces, and it will created erroneous data for a line like:
[1]> line
|
=> "MOUNT POINT: /dev/1 LABEL: /dev/1\n"
|
[2]> line.split(/:\s*|\s{2,}/)
|
=> ["MOUNT POINT", "/dev/1 LABEL", "/dev/1\n"]
|
This Array is passed to Hash which raises `odd number of arguments` because the number of arguments is odd:
https://github.com/puppetlabs/facter/blob/main/lib/facter/util/aix/info_extractor.rb#L19
Hash[*['a', 'b', 'c']]
|
ArgumentError: odd number of arguments for Hash
|
* Please see Zendesk Support tab for further comments and attachments.