diff --git a/bin/heat-db-setup-fedora b/bin/heat-db-setup-fedora index 00cb478586..9dc63749a1 100755 --- a/bin/heat-db-setup-fedora +++ b/bin/heat-db-setup-fedora @@ -213,17 +213,8 @@ if [ "${MYSQL_HEAT_PW}" != "${MYSQL_HEAT_PW_DEFAULT}" ] ; then sed -i -e "s/mysql:\/\/heat:\(.*\)@/mysql:\/\/heat:${MYSQL_HEAT_PW}@/" ${HEAT_CONFIG} fi -# Create the schema using sqlalchemy-migrate -if [ "$1" = "rpm" ] -then - pushd /usr/lib/python2.7/site-packages/heat/db/sqlalchemy -else - pushd /usr/lib/python2.7/site-packages/heat-0.0.1-py2.7.egg/heat/db/sqlalchemy/ -fi - -python manage.py version_control -python manage.py upgrade -popd +python -m heat.db.sqlalchemy.manage version_control +python -m heat.db.sqlalchemy.manage upgrade # Do a final sanity check on the database. diff --git a/heat/db/sqlalchemy/manage.py b/heat/db/sqlalchemy/manage.py old mode 100644 new mode 100755 index 4dffe78348..a0dd923aae --- a/heat/db/sqlalchemy/manage.py +++ b/heat/db/sqlalchemy/manage.py @@ -3,8 +3,12 @@ from migrate.versioning.shell import main import migrate.exceptions if __name__ == '__main__': + import os.path + migrate_repo_path = os.path.join(os.path.dirname(__file__), + 'migrate_repo') + try: main(url='mysql://heat:heat@localhost/heat', debug='False', - repository='migrate_repo') + repository=migrate_repo_path) except migrate.exceptions.DatabaseAlreadyControlledError: print 'Database already version controlled.'