Jira (FACT-3059) AIX reporting "odd number of arguments for Hash" with Facter 4

22 views
Skip to first unread message

Austin Boyd (Jira)

unread,
Jul 28, 2021, 9:20:03 AM7/28/21
to puppe...@googlegroups.com
Jordi Garcia created an issue
 
Facter / Bug FACT-3059
AIX reporting "odd number of arguments for Hash" with Facter 4
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2021/07/28 6:19 AM
Priority: Normal Normal
Reporter: Jordi Garcia

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

* Please see Zendesk Support tab for further comments and attachments.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Austin Boyd (Jira)

unread,
Jul 28, 2021, 9:20:03 AM7/28/21
to puppe...@googlegroups.com
Austin Boyd updated an issue
Change By: Austin Boyd
Zendesk Ticket Count: 1
Zendesk Ticket IDs: 45161

Austin Boyd (Jira)

unread,
Jul 28, 2021, 9:20:06 AM7/28/21
to puppe...@googlegroups.com

Gheorghe Popescu (Jira)

unread,
Jul 28, 2021, 9:29:03 AM7/28/21
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
Change By: Gheorghe Popescu
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:

{noformat}
[1]> line
=> "MOUNT POINT:        /dev/1 LABEL:          /dev/1\n"
[2]> line.split(/:\s*|\s{2,}/)
=> ["MOUNT POINT", "/dev/1 LABEL", "/dev/1\n"]
{noformat}


This Array is passed to Hash which raises `odd number of arguments because the number of arguments is even:
https://github.com/puppetlabs/facter/blob/main/lib/facter/util/aix/info_extractor.rb#L19


{noformat}
Hash[*['a', 'b', 'c']]
ArgumentError: odd number of arguments for Hash
{noformat}


~* Please see Zendesk Support tab for further comments and attachments.~

Gheorghe Popescu (Jira)

unread,
Jul 28, 2021, 9:29:04 AM7/28/21
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
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:

{noformat}
[1]> line
=> "MOUNT POINT:        /dev/1 LABEL:          /dev/1\n"
[2]> line.split(/:\s*|\s{2,}/)
=> ["MOUNT POINT", "/dev/1 LABEL", "/dev/1\n"]
{noformat}


This Array is passed to Hash which raises `odd number of arguments ` because the number of arguments is even odd :
https://github.com/puppetlabs/facter/blob/main/lib/facter/util/aix/info_extractor.rb#L19


{noformat}
Hash[*['a', 'b', 'c']]
ArgumentError: odd number of arguments for Hash
{noformat}


~* Please see Zendesk Support tab for further comments and attachments.~

Ciprian Badescu (Jira)

unread,
Jul 30, 2021, 8:28:03 AM7/30/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Aug 3, 2021, 4:55:04 AM8/3/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Aug 11, 2021, 5:04:02 AM8/11/21
to puppe...@googlegroups.com

Victor Bobosila (Jira)

unread,
Aug 11, 2021, 7:35:02 AM8/11/21
to puppe...@googlegroups.com

Victor Bobosila (Jira)

unread,
Aug 16, 2021, 6:46:02 AM8/16/21
to puppe...@googlegroups.com
Victor Bobosila updated an issue
Change By: Victor Bobosila
Release Notes: Bug Fix
Release Notes Summary: Fixed faulty regex on AIX that would result in an `odd number of arguments` error when resolving mountpoint facts

Ciprian Badescu (Jira)

unread,
Sep 8, 2021, 10:15:02 AM9/8/21
to puppe...@googlegroups.com

Claire Cadman (Jira)

unread,
Sep 9, 2021, 8:28:02 AM9/9/21
to puppe...@googlegroups.com
Claire Cadman updated an issue
Change By: Claire Cadman
Labels: doc-reviewed jira_escalated
Reply all
Reply to author
Forward
0 new messages