Jira (FACT-3078) custom-dir is silently skipped if it is not absolute path

29 views
Skip to first unread message

Ciprian Badescu (Jira)

unread,
Oct 6, 2021, 6:46:02 AM10/6/21
to puppe...@googlegroups.com
Ciprian Badescu created an issue
 
Facter / Task FACT-3078
custom-dir is silently skipped if it is not absolute path
Issue Type: Task Task
Assignee: Unassigned
Created: 2021/10/06 3:45 AM
Priority: Normal Normal
Reporter: Ciprian Badescu

When custom-dir is not an absolute path, Facter 4 logs a debug message and ignores the directory (behavior inherited from Facter 2) while Facter 3 accepts relative paths as custom-dir.

 

I suppose  Facter 4 behavior should match Facter 3 behavior.

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

Ciprian Badescu (Jira)

unread,
Oct 6, 2021, 6:47:03 AM10/6/21
to puppe...@googlegroups.com
Ciprian Badescu updated an issue
Change By: Ciprian Badescu
When custom-dir is not an absolute path, Facter 4 logs a debug message and ignores the directory (behavior inherited from Facter 2) while Facter 3 accepts relative paths as custom-dir.

 

I suppose  Facter 4 behavior should match Facter 3 behavior.


 
{code:java}
$ facter --custom-dir non-existing --debug 2>&1  | grep non-existing
[2021-10-06 13:46:20.375087 ] INFO Facter - executed with command line: --custom-dir non-existing --debug
[2021-10-06 13:46:20.376933 ] DEBUG LegacyFacter::Util::Loader - Excluding non-existing from search path. Fact file paths must be an absolute directory

{code}

Ciprian Badescu (Jira)

unread,
Oct 11, 2021, 10:19:02 AM10/11/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Oct 11, 2021, 10:19:02 AM10/11/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Oct 11, 2021, 10:19:03 AM10/11/21
to puppe...@googlegroups.com
Ciprian Badescu commented on Task FACT-3078
 
Re: custom-dir is silently skipped if it is not absolute path

should check if external-dir behaves the same way

Ciprian Badescu (Jira)

unread,
Oct 19, 2021, 10:34:03 AM10/19/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Oct 19, 2021, 10:34:04 AM10/19/21
to puppe...@googlegroups.com
 
Re: custom-dir is silently skipped if it is not absolute path

external-dir works with both absolute and relative path, but custom-dir only with absolute path

# more *fact/*    
::::::::::::::
custom-fact/mycustomfact.rb
::::::::::::::
Facter.add('mycustomfact') do
  setcode do
    '54321'
  end
end
::::::::::::::                               
external-fact/myfact.txt
::::::::::::::
myexternalfact=12345
# facter --external-dir external-fact/ --custom-dir custom-fact/ mycustomfact myexternalfact       
mycustomfact => 
myexternalfact => 12345
# facter --external-dir $PWD/external-fact/ --custom-dir $PWD/custom-fact/ mycustomfact myexternalfact
mycustomfact => 54321
myexternalfact => 12345
 
# facter --version
4.2.4

Josh Cooper (Jira)

unread,
Apr 21, 2022, 12:39:03 AM4/21/22
to puppe...@googlegroups.com
Josh Cooper commented on Task FACT-3078

Agreed Facter 4 should match 3:

# /opt/puppetlabs/puppet/bin/facter --version
3.14.23 (commit 46e6e6ffdecff72b75853af43a11acdf2d36752c)
# /opt/puppetlabs/puppet/bin/facter --external-dir external-fact/ --custom-dir custom-fact/ mycustomfact myexternalfact  
mycustomfact => 54321
myexternalfact => 12345
# /opt/puppetlabs/puppet/bin/facter-ng --version
4.2.8
# /opt/puppetlabs/puppet/bin/facter-ng --external-dir external-fact/ --custom-dir custom-fact/ mycustomfact myexternalfact  
mycustomfact => 
myexternalfact => 12345
This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo

Josh Cooper (Jira)

unread,
Apr 21, 2022, 10:48:04 AM4/21/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
Team: Night's Watch Phoenix

Josh Cooper (Jira)

unread,
Sep 13, 2022, 2:09:01 PM9/13/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: FACT 4.2.13
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Josh Cooper (Jira)

unread,
Sep 13, 2022, 2:09:03 PM9/13/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sprint: Phoenix 2022-09-28

Josh Cooper (Jira)

unread,
Sep 13, 2022, 2:16:02 PM9/13/22
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Sep 13, 2022, 2:48:02 PM9/13/22
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Sep 15, 2022, 12:58:02 PM9/15/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes: Bug Fix
Release Notes Summary: Fixes a regression in Facter 4 that prevented the user from specifying a custom directory using a relative path on the command line.

Josh Cooper (Jira)

unread,
Sep 15, 2022, 1:01:03 PM9/15/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes Summary:
Fixes a regression in Facter 4 that prevented the user from specifying a custom directory using a relative path on the command line.


Fix contributed by https://github.com/smortex

Parker Leach (Jira)

unread,
Oct 6, 2022, 6:02:01 PM10/6/22
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages