mirror of https://github.com/borgbase/vorta
* Raise meaningful error when Borg version found is too old. Fixes #283 * Start with compatible Borg version to pass tests.
This commit is contained in:
parent
3aa3d96360
commit
85e4d9d163
|
@ -3,6 +3,7 @@ from pkg_resources import parse_version
|
||||||
MIN_BORG_FOR_FEATURE = {
|
MIN_BORG_FOR_FEATURE = {
|
||||||
'BLAKE2': parse_version('1.1.4'),
|
'BLAKE2': parse_version('1.1.4'),
|
||||||
'ZSTD': parse_version('1.1.4'),
|
'ZSTD': parse_version('1.1.4'),
|
||||||
|
'JSON_LOG': parse_version('1.1.0')
|
||||||
# add new version-checks here.
|
# add new version-checks here.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +15,7 @@ class BorgCompatibility:
|
||||||
to customize Borg commands by version in the future.
|
to customize Borg commands by version in the future.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
version = '0.0'
|
version = '1.1.0'
|
||||||
path = ''
|
path = ''
|
||||||
|
|
||||||
def set_version(self, version, path):
|
def set_version(self, version, path):
|
||||||
|
|
|
@ -13,7 +13,7 @@ from subprocess import Popen, PIPE
|
||||||
|
|
||||||
from vorta.i18n import trans_late
|
from vorta.i18n import trans_late
|
||||||
from vorta.models import EventLogModel, BackupProfileMixin
|
from vorta.models import EventLogModel, BackupProfileMixin
|
||||||
from vorta.utils import keyring
|
from vorta.utils import keyring, borg_compat
|
||||||
from vorta.keyring.db import VortaDBKeyring
|
from vorta.keyring.db import VortaDBKeyring
|
||||||
|
|
||||||
mutex = QtCore.QMutex()
|
mutex = QtCore.QMutex()
|
||||||
|
@ -109,6 +109,10 @@ class BorgThread(QtCore.QThread, BackupProfileMixin):
|
||||||
ret['message'] = trans_late('messages', 'Add a backup repository first.')
|
ret['message'] = trans_late('messages', 'Add a backup repository first.')
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
if not borg_compat.check('JSON_LOG'):
|
||||||
|
ret['message'] = trans_late('messages', 'Your Borg version is too old. >=1.1.0 is required.')
|
||||||
|
return ret
|
||||||
|
|
||||||
# Try to get password from chosen keyring backend.
|
# Try to get password from chosen keyring backend.
|
||||||
logger.debug("Using %s keyring to store passwords.", keyring.__class__.__name__)
|
logger.debug("Using %s keyring to store passwords.", keyring.__class__.__name__)
|
||||||
ret['password'] = keyring.get_password('vorta-repo', profile.repo.url)
|
ret['password'] = keyring.get_password('vorta-repo', profile.repo.url)
|
||||||
|
|
Loading…
Reference in New Issue