#!/usr/bin/python
import sys
import neutron.db.migration.cli

def mfe_location(neutron_config):
    return "mfe_fwaas:alembic"

def main():
    '''Wrapper for neutron-db-manage cli tool

    mfe_fwaas uses its own alembic upgrade chain with a edicated
    'mfe_alembic_version' table in the neutron database.

    This wrapper monkey patches the alembic env.py location.

    TODO: neutron does not support downgrade but we could. At least
    we could support some kind of cleanup of of mfe tables.
    '''
    neutron.db.migration.cli.get_script_location = mfe_location
    sys.exit(neutron.db.migration.cli.main())

if __name__ == '__main__':
    sys.exit(main())

