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>
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
#!/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.'