Beispiel #1
0
def repo_valid(path):
    """
    utility function to check if borg can open a repository

    :param path: the path to the repository
    :returns: if borg can check the repository
    """
    with Repository(str(path), exclusive=True, create=False) as repository:
        # can't check raises() because check() handles the error
        return repository.check()
Beispiel #2
0
def repo_valid(path):
    """
    utility function to check if borg can open a repository

    :param path: the path to the repository
    :returns: if borg can check the repository
    """
    with Repository(str(path), create=False) as repository:
        # can't check raises() because check() handles the error
        return repository.check()
Beispiel #3
0
def repo_valid(path):
    """
    utility function to check if borg can open a repository

    :param path: the path to the repository
    :returns: if borg can check the repository
    """
    repository = Repository(str(path), create=False)
    # can't check raises() because check() handles the error
    state = repository.check()
    repository.close()
    return state