Skip to content

Conversation

@ekohl
Copy link
Collaborator

@ekohl ekohl commented Aug 10, 2020

In Ruby 2.7, performing true =~ %r{false}i raises a deprecation warning.

In Ruby 2.7, performing true =~ %r{false}i raises a deprecation warning.
@ekohl ekohl requested a review from a team as a code owner August 10, 2020 12:30
@puppet-community-rangefinder
Copy link

apache::bool2httpd is a function

that may have no external impact to Forge modules.

This module is declared in 174 of 575 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

Copy link
Contributor

@sanfrancrisko sanfrancrisko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting rid of the warning @ekohl !

@sanfrancrisko sanfrancrisko merged commit afbaf19 into puppetlabs:master Aug 14, 2020
sanfrancrisko added a commit to sanfrancrisko/puppetlabs-apache that referenced this pull request Oct 6, 2020
Use Ruby 2.7 compatible string matching
@blodone
Copy link

blodone commented Nov 27, 2020

since this code change our run failes with

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Failed to parse template apache/httpd.conf.erb:
  Filepath: /etc/puppetlabs/code/environments/production_master/modules/apache/lib/puppet/functions/apache/bool2httpd.rb
  Line: 28
  Detail: undefined method `match?' for "Off":String
 (file: /etc/puppetlabs/code/environments/production_master/modules/apache/manifests/init.pp, line: 795, column: 18)

@ekohl ekohl deleted the ruby-2.7 branch November 27, 2020 11:32
@ekohl
Copy link
Collaborator Author

ekohl commented Nov 27, 2020

Which Puppet and Ruby versions are used? The module is compatible with Puppet 5.5.10 and newer. The AIO install bundles Ruby 2.4 and that has the method.

@blodone
Copy link

blodone commented Nov 27, 2020

we are using puppet 5.5.14 and ruby 2.3.1p112. seems like its a ruby version thing

@ekohl
Copy link
Collaborator Author

ekohl commented Nov 27, 2020

It does indeed look like the method was introduced in Ruby 2.4.

@0x6d617474
Copy link

We are running puppet 5.5.22 with ruby 2.4.10p364 and also get the same error.

# /opt/puppetlabs/puppet/bin/ruby --version
ruby 2.4.10p364 (2020-03-31 revision 67879) [x86_64-linux]
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Failed to parse template apache/httpd.conf.erb:
  Filepath: /etc/puppetlabs/code/environments/puppet_module_updates/modules/apache/lib/puppet/functions/apache/bool2httpd.rb
  Line: 28
  Detail: undefined method `match?' for "On":String
 (file: /etc/puppetlabs/code/environments/puppet_module_updates/modules/apache/manifests/init.pp, line: 795, column: 18)

@sanfrancrisko
Copy link
Contributor

Hi folks,

We have a fix for this merged in #2102 and hope to get a new version of the module out this week.

daveseff pushed a commit to daveseff/puppetlabs-apache that referenced this pull request Jul 19, 2022
Use Ruby 2.7 compatible string matching
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants