Skip to content

Commit

Permalink
Merge pull request puppetlabs#1145 from david22swan/MODULES-8193
Browse files Browse the repository at this point in the history
(MODULES-8193) - Removal of inbuilt deepmerge and dirname functions
  • Loading branch information
tphoney authored Dec 13, 2018
2 parents ecce0b3 + 599947f commit 7b2273c
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 390 deletions.
66 changes: 0 additions & 66 deletions lib/puppet/functions/mysql/deepmerge.rb

This file was deleted.

20 changes: 0 additions & 20 deletions lib/puppet/functions/mysql/dirname.rb

This file was deleted.

58 changes: 0 additions & 58 deletions lib/puppet/parser/functions/mysql_deepmerge.rb

This file was deleted.

21 changes: 0 additions & 21 deletions lib/puppet/parser/functions/mysql_dirname.rb

This file was deleted.

2 changes: 1 addition & 1 deletion manifests/backup/mysqlbackup.pp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
'password' => $backuppassword,
}
}
$options = mysql::deepmerge($default_options, $mysql::server::override_options)
$options = $default_options.deep_merge($mysql::server::override_options)

file { 'mysqlbackup-config-file':
path => '/etc/mysql/conf.d/meb.cnf',
Expand Down
2 changes: 1 addition & 1 deletion manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
}

# Create a merged together set of options. Rightmost hashes win over left.
$options = mysql::deepmerge($mysql::params::default_options, $override_options)
$options = $mysql::params::default_options.deep_merge($override_options)

Class['mysql::server::root_password'] -> Mysql::Db <| |>

Expand Down
2 changes: 1 addition & 1 deletion manifests/server/binarylog.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
$logbin = pick($options['mysqld']['log-bin'], $options['mysqld']['log_bin'], false)

if $logbin {
$logbindir = mysql::dirname($logbin)
$logbindir = dirname($logbin)

#Stop puppet from managing directory if just a filename/prefix is specified
if $logbindir != '.' {
Expand Down
19 changes: 12 additions & 7 deletions manifests/server/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

# on some systems this is /etc/my.cnf.d, while Debian has /etc/mysql/conf.d and FreeBSD something in /usr/local. For the latter systems,
# managing this basedir is also required, to have it available before the package is installed.
$includeparentdir = mysql::dirname($includedir)
$includeparentdir = dirname($includedir)
if $includeparentdir != '/' and $includeparentdir != '/etc' {
file { $includeparentdir:
ensure => directory,
Expand All @@ -43,12 +43,17 @@

# on mariadb systems, $includedir is not defined, but /etc/my.cnf.d has
# to be managed to place the server.cnf there
$configparentdir = mysql::dirname($mysql::server::config_file)
if $configparentdir != '/' and $configparentdir != '/etc' and $configparentdir
!= $includedir and $configparentdir != mysql::dirname($includedir) {
file { $configparentdir:
ensure => directory,
mode => '0755',
$configparentdir = dirname($mysql::server::config_file)
# Before setting $configparentdir we first check to make sure that it's value is valid
if $configparentdir != '/' and $configparentdir != '/etc' {
# We then check that the value of $includedir is either undefined or that different from $configparentdir
# We first check that it is undefined due to dirname throwing an error when given undef/empty strings
if $includedir == undef or $includedir == '' or
($configparentdir != $includedir and $configparentdir != dirname($includedir)) {
file { $configparentdir:
ensure => directory,
mode => '0755',
}
}
}
}
Expand Down
94 changes: 0 additions & 94 deletions spec/functions/mysql_deepmerge_spec.rb

This file was deleted.

19 changes: 0 additions & 19 deletions spec/functions/mysql_dirname_spec.rb

This file was deleted.

Loading

0 comments on commit 7b2273c

Please sign in to comment.