"""
side_effects = True
provides = frozenset(["mysql_host", "mysql_user", "mysql_password", "mysql_db"])
+ def __init__(self, dir):
+ self.dir = dir
def prepare(self):
"""Uses :func:`wizard.scripts.get_sql_credentials`"""
self._triplet = scripts.get_sql_credentials()
def execute(self, options):
"""Creates a new database for the user using ``get-next-database`` and ``create-database``."""
sh = shell.Shell()
- name = os.path.basename(os.getcwd())
options.mysql_host, options.mysql_user, options.mysql_password = self._triplet
# race condition
- options.mysql_db = self._username + '+' + sh.eval("/mit/scripts/sql/bin/get-next-database", name)
+ options.mysql_db = self._username + '+' + sh.eval("/mit/scripts/sql/bin/get-next-database", os.path.basename(self.dir))
sh.call("/mit/scripts/sql/bin/create-database", options.mysql_db)
class ScriptsEmailStrategy(Strategy):
raw_strategies = [
EnvironmentStrategy(self),
ScriptsWebStrategy(dir),
- ScriptsMysqlStrategy(),
+ ScriptsMysqlStrategy(dir),
ScriptsEmailStrategy(),
]
for arg in self.args.values():