Skip to content

Commit

Permalink
Use retrocompatible syntax for chef > 12.7 and adapt version contrain…
Browse files Browse the repository at this point in the history
…ts to respect Chef::Exceptions::ObsoleteDependencySyntax (#898)
  • Loading branch information
chouetz authored Jul 6, 2023
1 parent 1657210 commit 9749bd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@
depends 'apt'
end

# Use '< 5.0' with Chef < 12.14
# Must be '>= 3.0' and '< 5.0' with Chef < 12.14
# Chef allows only one constraint and '~> 3.0' means '>= 3.0' and '< 4.0'
if current_chef_version < Gem::Version.new(12.14)
depends 'yum', '>= 3.0', '< 5.0'
depends 'yum', '~> 3.0'
else
depends 'yum', '>= 3.0'
end
2 changes: 1 addition & 1 deletion resources/monitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
init_config = new_resource.init_config
if new_resource.is_jmx
init_config ||= {}
init_config = init_config.merge({ 'is_jmx': true, 'collect_default_metrics': true })
init_config = init_config.merge({ 'is_jmx' => true, 'collect_default_metrics' => true })
end

variables(
Expand Down

0 comments on commit 9749bd6

Please sign in to comment.