Skip to content

Commit

Permalink
Closes-Bug: #1602872 - User configured database dir not created if pa…
Browse files Browse the repository at this point in the history
…th doesn't exist

for example: if user gives /var/lib/cassandra/data as database_dir, it won't be created as /var/lib/cassandra dir doesn't exist

Change-Id: I346d0b2c20c549e368ebff52008297be9a5ca588
  • Loading branch information
nitishkrishna committed Sep 27, 2016
1 parent 5e455be commit 541467e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,16 @@
notify { "Database - zookeeper_ip_list = ${zookeeper_ip_list}":;} ->
notify { "Database - database_index = ${database_index}":;} ->
notify { "Database - cassandra_seeds = ${cassandra_seeds}":;} ->
exec {'Create database dir':
command => "mkdir -p ${database_dir}",
unless => "test -d ${database_dir}",
provider => shell,
logoutput => $contrail_logoutput
} ->
file { $database_dir :
ensure => directory,
owner => cassandra,
group => cassandra,
ensure => directory,
owner => cassandra,
group => cassandra,
} ->
class {'::contrail::config_cassandra':
cassandra_seeds => $cassandra_seeds,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@

# Debug - Print all variables
notify { "Database - cassandra_seeds = ${cassandra_seeds}":;} ->
exec {'Create database dir':
command => "mkdir -p ${database_dir}",
unless => "test -d ${database_dir}",
provider => shell,
logoutput => $contrail_logoutput
} ->
file { $database_dir :
ensure => directory,
owner => cassandra,
Expand Down

0 comments on commit 541467e

Please sign in to comment.