コード例 #1
0
ファイル: migration_helpers.py プロジェクト: sandlbn/keystone
def find_migrate_repo(package=None, repo_name='migrate_repo'):
    package = package or sql
    path = os.path.abspath(os.path.join(
        os.path.dirname(package.__file__), repo_name))
    if os.path.isdir(path):
        return path
    raise exception.MigrationNotProvided(package.__name__, path)
コード例 #2
0
ファイル: upgrades.py プロジェクト: todd911/keystone
def find_repo(repo_name):
    """Return the absolute path to the named repository."""
    path = os.path.abspath(os.path.join(
        os.path.dirname(sql.__file__), repo_name))

    if not os.path.isdir(path):
        raise exception.MigrationNotProvided(sql.__name__, path)

    return path
コード例 #3
0
ファイル: upgrades.py プロジェクト: openstack/keystone
def _get_migrate_repo_path(branch):
    abs_path = os.path.abspath(
        os.path.join(
            os.path.dirname(sql.__file__),
            'legacy_migrations',
            f'{branch}_repo',
        )
    )

    if not os.path.isdir(abs_path):
        raise exception.MigrationNotProvided(sql.__name__, abs_path)

    return abs_path