Inconsistency between NASHVEGAS docs & code #28

Closed
ptoal opened this Issue Oct 14, 2011 · 1 comment

Projects

None yet

2 participants

@ptoal

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?

@paltman

@ptoal This has been fixed for a while now I think. Sorry I am so late responding to this issue. Thanks.

@paltman paltman closed this Jul 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment