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/
|
pushd /usr/lib/python2.7/site-packages/heat-0.0.1-py2.7.egg/heat/db/sqlalchemy/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
python migrate_repo/manage.py version_control mysql://heat:heat@localhost/heat migrate_repo
|
python manage.py version_control
|
||||||
python manage.py upgrade
|
python manage.py upgrade
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
from migrate.versioning.shell import main
|
from migrate.versioning.shell import main
|
||||||
|
import migrate.exceptions
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
try:
|
||||||
main(url='mysql://heat:heat@localhost/heat', debug='False',
|
main(url='mysql://heat:heat@localhost/heat', debug='False',
|
||||||
repository='migrate_repo')
|
repository='migrate_repo')
|
||||||
|
except migrate.exceptions.DatabaseAlreadyControlledError:
|
||||||
|
print 'Database already version controlled.'
|
||||||
|
|
Loading…
Reference in New Issue