~zirpu/charms/precise/haproxy/fix-stop-hook

« back to all changes in this revision

Viewing changes to formulas/mysql/hooks/db-relation-changed

  • Committer: Clint Byrum
  • Date: 2011-03-15 18:14:07 UTC
  • Revision ID: clint@ubuntu.com-20110315181407-ru5zzlodbdurgmzy
- quote mysql database names
- only try to configure fully related units in reverseproxy

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
    if database_name not in databases:
38
38
      # Create new database
39
39
      cursor.execute(
40
 
          "create database %s character set utf8" % database_name)
 
40
          "create database `%s` character set utf8" % database_name)
41
41
 
42
42
    # Create database user and grant access
43
43
    service_password = "".join(random.sample(string.letters, 10))
81
81
def on_depart():
82
82
    cursor = get_db_cursor()
83
83
    cursor.execute("revoke all privileges on `%s`.* from `%s`" % (database_name, user))
84
 
    print "revoked privileges for %s on database %s" % (user, database_name)
 
84
    print "revoked privileges for `%s` on database `%s`" % (user, database_name)
85
85
 
86
86
if change_type == "joined":
87
87
    on_join()