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()
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()
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