Skip to content

Commit a0df349

Browse files
committed
Merge pull request #154 from Paulche/master
Fix issue with redeclaration of database_user via mysql::db
2 parents ffc857d + 1d6ca77 commit a0df349

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

manifests/db.pp

+5-6
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,13 @@
5252
charset => $charset,
5353
provider => 'mysql',
5454
require => Class['mysql::server'],
55+
before => Database_user["${user}@${host}"],
5556
}
5657

57-
database_user { "${user}@${host}":
58-
ensure => $ensure,
59-
password_hash => mysql_password($password),
60-
provider => 'mysql',
61-
require => Database[$name],
62-
}
58+
ensure_resource('database_user', "${user}@${host}", { ensure => $ensure,
59+
password_hash => mysql_password($password),
60+
provider => 'mysql'
61+
})
6362

6463
if $ensure == 'present' {
6564
database_grant { "${user}@${host}/${name}":

spec/unit/mysql_password_spec.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
end
88

99
before :each do
10-
@scope = Puppet::Parser::Scope.new
10+
@scope = if Puppet.version =~ /^3/
11+
Puppet::Parser::Scope.new_for_test_harness('localhost')
12+
else
13+
Puppet::Parser::Scope.new
14+
end
1115
end
1216

1317
it "should exist" do

0 commit comments

Comments
 (0)