~chad.smith/charms/precise/postgresql/postgresql-using-storage-subordinate

« back to all changes in this revision

Viewing changes to hooks/db-relation-broken

  • Committer: Mark Mims
  • Date: 2011-07-10 09:53:13 UTC
  • Revision ID: mark.mims@canonical.com-20110710095313-twc6hxeuf0ei1hzx
convert

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
import os
 
4
 
 
5
from common import *
 
6
 
 
7
print "Relationship with %s broken." % database_name
 
8
 
 
9
open(broken_path,'w').close()
 
10
 
 
11
cursor = get_db_cursor()
 
12
try:
 
13
    cursor.execute("revoke all privileges on `%s`.* from `%s`" % (database_name, user))
 
14
    print "revoked privileges for `%s` on database `%s`" % (user, database_name)
 
15
except Exception as e:
 
16
    print "revoking failed, possibly incomplete relation. %s" % (e)
 
17
 
 
18
if slave and slave_configured:
 
19
    os.unlink(slave_configured_path)