But this won't actually execute properly. The issue is that the code doesn't create the right commands. eg:
def setup_database(self):
command = "createdb %s" % self.name
if NASHVEGAS and "createdb" in settings.NASHVEGAS:
command = settings.NASHVEGAS["createdb"]
Popen(command.split()).wait()
If you don't specify the NASHVEGAS settings, it tries to execute a command like:
createdb mydb_compare
(where mydb_compare is generated, or passed as an option on the CLI)
If you specify NASHVEGAS["createdb"] as in the example, you get:
createdb -U postgres -T template0 -E UTF8
(no DB name provided)
I believe the "fix" is to have code similar to the following (for setup_database, teardown_database, and handle)
command = settings.NASHVEGAS["createdb"] + " %s" % self.name
The docs show an example:
NASHVEGAS = { "createdb": "createdb -U postgres -T template0 -E UTF8", "dropdb": "dropdb -U postgres", "pg_dump": "pg_dump -U postgres", }
But this won't actually execute properly. The issue is that the code doesn't create the right commands. eg: def setup_database(self): command = "createdb %s" % self.name if NASHVEGAS and "createdb" in settings.NASHVEGAS: command = settings.NASHVEGAS["createdb"] Popen(command.split()).wait()
If you don't specify the NASHVEGAS settings, it tries to execute a command like: createdb mydb_compare
(where mydb_compare is generated, or passed as an option on the CLI)
If you specify NASHVEGAS["createdb"] as in the example, you get: createdb -U postgres -T template0 -E UTF8 (no DB name provided)
I believe the "fix" is to have code similar to the following (for setup_database, teardown_database, and handle) command = settings.NASHVEGAS["createdb"] + " %s" % self.name
Comments?