paltman/nashvegas — Issue #28: Inconsistency between NASHVEGAS docs & code
Author: ptoal
Created: 2011-10-14 20:19:01+00:00
State: open

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?