voxpupuli / puppet-jira

Atlassian JIRA Puppet Module
https://forge.puppet.com/puppet/jira
Apache License 2.0
62 stars 143 forks source link

Jira_facts deprecation warnings #330

Closed Kidswiss closed 3 years ago

Kidswiss commented 3 years ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

class { 'jira::facts': }

What are you seeing

Warning: Facter: external fact file "/etc/facter/facts.d/jira_facts.rb" had output on stderr: /etc/facter/facts.d/jira_facts.rb:17: warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open

What behaviour did you expect instead

No warnings

Output log

Warning: Facter: external fact file "/etc/facter/facts.d/jira_facts.rb" had output on stderr: /etc/facter/facts.d/jira_facts.rb:17: warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open
Info: Using configured environment 'CustomerInfra'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Warning: Facter: external fact file "/etc/facter/facts.d/jira_facts.rb" had output on stderr: /etc/facter/facts.d/jira_facts.rb:17: warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open
Info: Caching catalog for jira01-qual.node.customer.cloud
Notice: Applied catalog in 14.88 seconds
Kidswiss commented 3 years ago

Using following changes to /etc/facter/facts.d/jira_facts.rb seem to fix the problem:

+  info = OpenURI.open_uri(url, &:read)
-  info = open(url, &:read)