~cjwatson/charms/precise/postgresql/debversion

« back to all changes in this revision

Viewing changes to hooks/db-relation-joined

  • Committer: Mark Mims
  • Date: 2011-07-13 23:08:31 UTC
  • Revision ID: mark.mims@canonical.com-20110713230831-9apq64smlj8q4jo7
updates

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
    print "database exists, assuming configuration has happened already"
15
15
    sys.exit(0)
16
16
 
17
 
create_user(user,database_name)
 
17
service_password = "".join(random.sample(string.letters, 10))
 
18
 
 
19
create_user(user,service_password)
 
20
create_database(database_name,user)
18
21
 
19
22
hostname = subprocess.check_output(['hostname','-f']).strip()
20
23
 
21
 
# Create new database or touch slave.configured file
22
 
runsql("create database `%s` character set utf8" % database_name)
23
 
 
24
24
# Store new values in relation settings.
25
25
subprocess.call(
26
26
    ["relation-set",