Skip to content

Commit 00ef877

Browse files
committed
[database] Use dburl variable properly
1 parent c3ac20f commit 00ef877

2 files changed

Lines changed: 15 additions & 8 deletions

File tree

manifests/config.pp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,7 @@
161161
change_dbpassword => $jira::change_dbpassword,
162162
dbtype => $dbtype,
163163
dbschema => $dbschema,
164-
dburl => pick($jira::dburl, $jira::db ? {
165-
'postgresql' => "jdbc:${jira::db}://${jira::dbserver}:${dbport}/${jira::dbname}",
166-
'mysql' => "jdbc:${jira::db}://${jira::dbserver}:${dbport}/${jira::dbname}?useUnicode=true&characterEncoding=UTF8&sessionVariables=default_storage_engine=InnoDB",
167-
'oracle' => "jdbc:${jira::db}:thin:@${jira::dbserver}:${dbport}${oracle_separator}${jira::dbname}",
168-
'sqlserver' => "jdbc:jtds:${jira::db}://${jira::dbserver}:${dbport}/${jira::dbname}",
169-
'h2' => "jdbc:h2:file:/${jira::homedir}/database/${jira::dbname}",
170-
}
171-
),
164+
dburl => $dburl,
172165
dbdriver => $dbdriver,
173166
dbuser => $jira::dbuser,
174167
dbpassword => $jira::dbpassword,

spec/classes/jira_config_spec.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,20 @@ def self.clear_cache
305305
end
306306
end
307307

308+
context 'oracle custom dburl' do
309+
let(:params) do
310+
super().merge(
311+
db: 'oracle',
312+
dburl: 'jdbc:oracle:thin:@localhost:1521/mydatabase'
313+
)
314+
end
315+
316+
it do
317+
is_expected.to contain_file(FILENAME_DBCONFIG_XML).
318+
with_content(%r{jdbc:oracle:thin:@localhost:1521/mydatabase})
319+
end
320+
end
321+
308322
context 'postgres params' do
309323
let(:params) do
310324
super().merge(

0 commit comments

Comments
 (0)