Created
May 1, 2013 15:36
-
-
Save hub-cap/5496028 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def create_user(self, context, users): | |
| cur = get_engine().cursor() | |
| for item in users: | |
| user = models.MySQLUser() | |
| user.deserialize(item) | |
| cur.execute("CREATE ROLE %s LOGIN PASSWORD '%s'" % | |
| (user.name, user.password)) | |
| for database in user.databases: | |
| mydb = models.MySQLDatabase() | |
| mydb.deserialize(database) | |
| cur.execute("CREATE DATABASE %s OWNER %s" | |
| % (mydb.name, user.name)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment