
from neutron.db.migration.cli import *  # noqa


def main():
    config = alembic_config.Config(
        os.path.join(os.path.dirname(__file__), 'alembic.ini'))
    config.set_main_option(
        'script_location',
        'gbpservice.neutron.db.migration:alembic_migrations')
    config.neutron_config = CONF
    CONF()
    CONF.command.func(config, CONF.command.name)


from neutron.db.migration.cli import *  # noqa


def main():
    config = alembic_config.Config(
        os.path.join(os.path.dirname(__file__), 'alembic.ini'))
    config.set_main_option(
        'script_location',
        'gbpservice.neutron.db.migration:alembic_migrations')
    config.neutron_config = CONF
    CONF(project='neutron')
    CONF.command.func(config, CONF.command.name)

Set project when doing neutron DB migrations
Set project when doing neutron DB migrations

That way, the default configuration files/dirs from the neutron
projects are read when doing the DB migrations.
This is useful if eg. some configuration files are in
/etc/neutron/neutron.conf.d/ . Theses files will then be automatically
evaluated.

Change-Id: I4997a86c4df5fa45f7682d653a5e66b1ae184a62

  
  from neutron.db.migration.cli import *  # noqa
  
  
  def main():
      config = alembic_config.Config(
          os.path.join(os.path.dirname(__file__), 'alembic.ini'))
      config.set_main_option(
          'script_location',
          'gbpservice.neutron.db.migration:alembic_migrations')
      config.neutron_config = CONF
-     CONF()
+     CONF(project='neutron')
      CONF.command.func(config, CONF.command.name)
  
Set project when doing neutron DB migrations
## Code Before:

from neutron.db.migration.cli import *  # noqa


def main():
    config = alembic_config.Config(
        os.path.join(os.path.dirname(__file__), 'alembic.ini'))
    config.set_main_option(
        'script_location',
        'gbpservice.neutron.db.migration:alembic_migrations')
    config.neutron_config = CONF
    CONF()
    CONF.command.func(config, CONF.command.name)

## Instruction:
Set project when doing neutron DB migrations
## Code After:

from neutron.db.migration.cli import *  # noqa


def main():
    config = alembic_config.Config(
        os.path.join(os.path.dirname(__file__), 'alembic.ini'))
    config.set_main_option(
        'script_location',
        'gbpservice.neutron.db.migration:alembic_migrations')
    config.neutron_config = CONF
    CONF(project='neutron')
    CONF.command.func(config, CONF.command.name)
