Excerpts from Shawn Doherty's message of 2017-07-25 14:35 -04:00:
Thanks for the description
something flukey here for me.
I have auto generated 3dd091c46d50 as head using alembic revision, but
db version stays at f18df089261. Using methods described above,
including beaker-init (--downgrade)have no affect on the db version.
I can interact with the db with the alembic stamp command but only to
maniuplate the version_number. Other db changes do not seem to be
affected.
Thoughts?
Are you possibly running this on a system where you have your git
checkout, but you *also* have a copy of Beaker installed system-wide in
/usr/lib/python2.6/site-packages from the beaker-server RPM?
If so, beaker-init might be loading the migrations from site-packages
instead of from the source checkout. It uses pkg_resources which obeys
sys.path, sometimes '/usr/lib/python2.6/site-packages' sneaks itself
onto the front of sys.path, usually due to hackery with *.pth files from
some package or other.
The alembic command is looking in its .ini file to find the migrations,
which would be why it sees the ones in the git checkout as you expect.
Whereas beaker-init uses pkg_resources to find them, so that it works
even when it is installed as an RPM package.
alembic history
Rev: 3dd091c46d50 (head)
Parent: f18df089261
Path: bkr/server/alembic/versions/3dd091c46d50_.py
empty message
Revision ID: 3dd091c46d50
Revises: f18df089261
Create Date: 2017-07-25 18:03:04.320470
Rev: f18df089261
Parent: 4f7a4316565f
Path:
bkr/server/alembic/versions/f18df089261_associate_a_floating_ip_to_each_openstack_instance.py
associate a floating ip to each OpenStack instance
Revision ID: f18df089261
Revises: 4f7a4316565f
Create Date: 2016-12-05 05:59:28.858413
root@beaker-server-lc Server]# PYTHONPATH=../Common:. python
bkr/server/tools/init.py --debug
2017-07-25 18:06:40,981 __main__ INFO Upgrading schema to head revision
2017-07-25 18:06:40,981 alembic.migration INFO Context impl MySQLImpl.
2017-07-25 18:06:40,981 alembic.migration INFO Will assume
non-transactional DDL.
2017-07-25 18:06:40,987 __main__ INFO Upgrade completed
2017-07-25 18:06:40,987 __main__ INFO Populating tables with
pre-defined values if necessary
2017-07-25 18:06:41,225 __main__ INFO Pre-defined values populated
2017-07-25 18:06:41,226 __main__ INFO Exiting
SELECT * FROM alembic_version;
+-------------+
| version_num |
+-------------+
| f18df089261 |
+-------------+
> --
> Dan Callaghan <dcallagh(a)redhat.com>
> Senior Software Engineer, Products & Technologies Operations
> Red Hat
--
Dan Callaghan <dcallagh(a)redhat.com>
Senior Software Engineer, Products & Technologies Operations
Red Hat