Skip to content

Commit

Permalink
MODULES-1759: Remove dependency on stdlib >=4.1.0
Browse files Browse the repository at this point in the history
Backported dirname => mysql_dirname since updating dependency to stdlib
4.1.0 is backwards incompatible with some versions of PE.
  • Loading branch information
Morgan Haskel committed Feb 9, 2015
1 parent b57191f commit 96f4d16
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
15 changes: 15 additions & 0 deletions lib/puppet/parser/functions/mysql_dirname.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module Puppet::Parser::Functions
newfunction(:mysql_dirname, :type => :rvalue, :doc => <<-EOS
Returns the dirname of a path.
EOS
) do |arguments|

raise(Puppet::ParseError, "mysql_dirname(): Wrong number of arguments " +
"given (#{arguments.size} for 1)") if arguments.size < 1

path = arguments[0]
return File.dirname(path)
end
end

# vim: set ts=2 sw=2 et :
2 changes: 1 addition & 1 deletion manifests/server/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
$logbin = pick($options['mysqld']['log-bin'], $options['mysqld']['log_bin'], false)

if $logbin {
$logbindir = dirname($logbin)
$logbindir = mysql_dirname($logbin)
file { $logbindir:
ensure => directory,
mode => '0755',
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
],
"description": "Mysql module",
"dependencies": [
{"name":"puppetlabs/stdlib","version_requirement":">= 4.1.0 < 5.0.0"},
{"name":"puppetlabs/stdlib","version_requirement":">= 3.2.0 < 5.0.0"},
{"name":"nanliu/staging","version_requirement":"1.x"}
]
}

0 comments on commit 96f4d16

Please sign in to comment.