Skip to content

Commit

Permalink
MODULES-1928 - allow log-error to be undef
Browse files Browse the repository at this point in the history
Wrap the file resource so that this doesn't explode if log-error is
undef. This is required for syslogging.
  • Loading branch information
Morgan Haskel committed Apr 14, 2015
1 parent eb3fa4e commit 298242e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
10 changes: 6 additions & 4 deletions manifests/server/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
$mysqluser = $options['mysqld']['user']
}

file { $options['mysqld']['log-error']:
ensure => present,
owner => $mysqluser,
group => $::mysql::server::mysql_group,
if $options['mysqld']['log-error'] {
file { $options['mysqld']['log-error']:
ensure => present,
owner => $mysqluser,
group => $::mysql::server::mysql_group,
}
}

service { 'mysqld':
Expand Down
13 changes: 13 additions & 0 deletions spec/acceptance/mysql_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,18 @@ class { 'mysql::server':
apply_manifest(pp, :catch_changes => true)
end
end

describe 'configuration needed for syslog' do
it 'should work with no errors' do
pp = <<-EOS
class { 'mysql::server':
override_options => { 'mysqld' => { 'log-error' => undef }, 'mysqld_safe' => { 'log-error' => false, 'syslog' => true }},
}
EOS

apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
end
end

0 comments on commit 298242e

Please sign in to comment.