Correction script fabric pour cloner la base
This commit is contained in:
parent
3c6d05e0e3
commit
77f4c5f832
1 changed files with 3 additions and 3 deletions
6
scripts/fabfile.py
vendored
6
scripts/fabfile.py
vendored
|
|
@ -27,8 +27,8 @@ def clone_remote_db(conn):
|
|||
if is_sqlite:
|
||||
return os.path.exists(db_name)
|
||||
else: # Assume postgres
|
||||
db_list = local.run('psql --list', capture=True)
|
||||
return (' ' + db_name + ' ') in db_list
|
||||
res = local.run('psql --list', hide='stdout')
|
||||
return db_name in res.stdout.split()
|
||||
|
||||
if exist_local_db():
|
||||
rep = input('A local database named "%s" already exists. Overwrite? (y/n)' % db_name)
|
||||
|
|
@ -44,7 +44,7 @@ def clone_remote_db(conn):
|
|||
with conn.cd(APP_DIR):
|
||||
with conn.prefix('source %s' % VIRTUALENV_DIR):
|
||||
conn.run('python manage.py dumpdata --natural-foreign --indent 1 -e auth.Permission auth stages candidats > epcstages.json')
|
||||
conn.get('epcstages.json', '.')
|
||||
conn.get('/var/www/epcstages/epcstages.json', None)
|
||||
|
||||
if not is_sqlite:
|
||||
local.run(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue