def db_version_dodai():
    repo_path = _find_migrate_repo_dodai()
    try:
        return versioning_api.db_version(FLAGS.sql_connection_dodai, repo_path)
    except versioning_exceptions.DatabaseNotControlledError:
        # If we aren't version controlled we may already have the database
        # in the state from before we started version control, check for that
        # and set up version_control appropriately
        meta = sqlalchemy.MetaData()
        engine = sqlalchemy.create_engine(FLAGS.sql_connection_dodai, echo=False)
        meta.reflect(bind=engine)
        try:
            for table in ("bare_metal_machines"):
                assert table in meta.tables
            return db_version_control_dodai(1)
        except __HOLE__:
            return db_version_control_dodai(0)
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/db/sqlalchemy/migration.py/db_version_dodai