← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1397796] Re: alembic v. 0.7.1 will support "remove_fk" and others not expected by heal_script

 

** Also affects: neutron/juno
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1397796

Title:
  alembic v. 0.7.1 will support "remove_fk" and others not expected by
  heal_script

Status in OpenStack Neutron (virtual network service):
  Fix Committed
Status in neutron juno series:
  New

Bug description:
  neutron/db/migration/alembic_migrations/heal_script.py seems to have a
  hardcoded notion of what commands Alembic is prepared to pass within
  the execute_alembic_command() call.   When Alembic 0.7.1 is released,
  the tests in neutron.tests.unit.db.test_migration will fail as
  follows:

  Traceback (most recent call last):
        File "neutron/tests/unit/db/test_migration.py", line 194, in test_models_sync
          self.db_sync(self.get_engine())
        File "neutron/tests/unit/db/test_migration.py", line 136, in db_sync
          migration.do_alembic_command(self.alembic_config, 'upgrade', 'head')
        File "neutron/db/migration/cli.py", line 61, in do_alembic_command
          getattr(alembic_command, cmd)(config, *args, **kwargs)
        File "/var/jenkins/workspace/openstack_sqla_master/neutron/.tox/sqla_py27/lib/python2.7/site-packages/alembic/command.py", line 165, in upgrade
          script.run_env()
        File "/var/jenkins/workspace/openstack_sqla_master/neutron/.tox/sqla_py27/lib/python2.7/site-packages/alembic/script.py", line 382, in run_env
          util.load_python_file(self.dir, 'env.py')
        File "/var/jenkins/workspace/openstack_sqla_master/neutron/.tox/sqla_py27/lib/python2.7/site-packages/alembic/util.py", line 241, in load_python_file
          module = load_module_py(module_id, path)
        File "/var/jenkins/workspace/openstack_sqla_master/neutron/.tox/sqla_py27/lib/python2.7/site-packages/alembic/compat.py", line 79, in load_module_py
          mod = imp.load_source(module_id, path, fp)
        File "neutron/db/migration/alembic_migrations/env.py", line 109, in <module>
          run_migrations_online()
        File "neutron/db/migration/alembic_migrations/env.py", line 100, in run_migrations_online
          context.run_migrations()
        File "<string>", line 7, in run_migrations
        File "/var/jenkins/workspace/openstack_sqla_master/neutron/.tox/sqla_py27/lib/python2.7/site-packages/alembic/environment.py", line 742, in run_migrations
          self.get_context().run_migrations(**kw)
        File "/var/jenkins/workspace/openstack_sqla_master/neutron/.tox/sqla_py27/lib/python2.7/site-packages/alembic/migration.py", line 305, in run_migrations
          step.migration_fn(**kw)
        File "/var/jenkins/workspace/openstack_sqla_master/neutron/neutron/db/migration/alembic_migrations/versions/1d6ee1ae5da5_db_healing.py", line 32, in upgrade
          heal_script.heal()
        File "neutron/db/migration/alembic_migrations/heal_script.py", line 81, in heal
          execute_alembic_command(el)
        File "neutron/db/migration/alembic_migrations/heal_script.py", line 92, in execute_alembic_command
          METHODS[command[0]](*command[1:])
      KeyError: 'remove_fk'
      

  I'll send a review for the obvious fix though I have a suspicion
  there's something more deliberate going on here, so consider this just
  a heads up!

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1397796/+subscriptions


References