Jira (PUP-10300) find_file function returns path even if absolute path does not exit

9 views
Skip to first unread message

Florian Faltermeier (JIRA)

unread,
Feb 19, 2020, 7:13:05 AM2/19/20
to puppe...@googlegroups.com
Florian Faltermeier created an issue
 
Puppet / Bug PUP-10300
find_file function returns path even if absolute path does not exit
Issue Type: Bug Bug
Affects Versions: PUP 6.12.0
Assignee: Henrik Lindberg
Components: Functions
Created: 2020/02/19 4:12 AM
Priority: Normal Normal
Reporter: Florian Faltermeier

Puppet Version: 6.12
Puppet Server Version: 6.7.2
OS Name/Version: CentOS 7

find_file function returns path even if absolute path does not exit

Desired Behavior:

The function should return undef/false if none of the given paths were found

Actual Behavior:

The function returns the path if file does not exist

e.g. : find_file('/etc/testfile')

 

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Henrik Lindberg (JIRA)

unread,
Feb 19, 2020, 8:35:06 AM2/19/20
to puppe...@googlegroups.com
Henrik Lindberg assigned an issue to Unassigned
Change By: Henrik Lindberg
Assignee: Henrik Lindberg

Henrik Lindberg (JIRA)

unread,
Feb 19, 2020, 8:35:07 AM2/19/20
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Feb 19, 2020, 2:52:07 PM2/19/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-10300
 
Re: find_file function returns path even if absolute path does not exit

The function is supposed to return undef/nil if not found, which it appears to do in: https://github.com/puppetlabs/puppet/blob/6.12.0/lib/puppet/functions/find_file.rb#L35-L43. It's possible that code is misbehaving under JRuby, which could affect our Puppet::FileSystem methods. Are you sure the file doesn't exist, as opposed to puppetserver doesn't have read permission to the file, it's a dangling symlink, or something else?

Reply all
Reply to author
Forward
0 new messages