Avoid printing exception in db-setup
If the db-setup is run multiple times without dropping the database, the attempt to set up version control again causes an exception. Since this is an expected condition, just print a message and exit normally. Signed-off-by: Zane Bitter <zbitter@redhat.com>
This commit is contained in:
parent
f94547743e
commit
d4fda02735
@ -221,7 +221,7 @@ else
|
||||
pushd /usr/lib/python2.7/site-packages/heat-0.0.1-py2.7.egg/heat/db/sqlalchemy/
|
||||
fi
|
||||
|
||||
python migrate_repo/manage.py version_control mysql://heat:heat@localhost/heat migrate_repo
|
||||
python manage.py version_control
|
||||
python manage.py upgrade
|
||||
popd
|
||||
|
||||
|
@ -1,6 +1,10 @@
|
||||
#!/usr/bin/env python
|
||||
from migrate.versioning.shell import main
|
||||
import migrate.exceptions
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(url='mysql://heat:heat@localhost/heat', debug='False',
|
||||
repository='migrate_repo')
|
||||
try:
|
||||
main(url='mysql://heat:heat@localhost/heat', debug='False',
|
||||
repository='migrate_repo')
|
||||
except migrate.exceptions.DatabaseAlreadyControlledError:
|
||||
print 'Database already version controlled.'
|
||||
|
Loading…
x
Reference in New Issue
Block a user