1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-03-15 16:40:23 +00:00

fix badly named environment variable, fixes #503

added: BORG_DELETE_I_KNOW_WHAT_I_AM_DOING for the check in "borg delete"
This commit is contained in:
Thomas Waldmann 2015-12-20 02:03:33 +01:00
parent ae4a56997f
commit 57b913bc88
4 changed files with 5 additions and 1 deletions

View file

@ -351,7 +351,7 @@ class Archiver:
msg.append("Type 'YES' if you understand this and want to continue: ") msg.append("Type 'YES' if you understand this and want to continue: ")
msg = '\n'.join(msg) msg = '\n'.join(msg)
if not yes(msg, false_msg="Aborting.", default_notty=False, if not yes(msg, false_msg="Aborting.", default_notty=False,
env_var_override='BORG_CHECK_I_KNOW_WHAT_I_AM_DOING', truish=('YES', )): env_var_override='BORG_DELETE_I_KNOW_WHAT_I_AM_DOING', truish=('YES', )):
self.exit_code = EXIT_ERROR self.exit_code = EXIT_ERROR
return self.exit_code return self.exit_code
repository.destroy() repository.destroy()

View file

@ -199,6 +199,7 @@ class ArchiverTestCaseBase(BaseTestCase):
def setUp(self): def setUp(self):
os.environ['BORG_CHECK_I_KNOW_WHAT_I_AM_DOING'] = '1' os.environ['BORG_CHECK_I_KNOW_WHAT_I_AM_DOING'] = '1'
os.environ['BORG_DELETE_I_KNOW_WHAT_I_AM_DOING'] = '1'
self.archiver = not self.FORK_DEFAULT and Archiver() or None self.archiver = not self.FORK_DEFAULT and Archiver() or None
self.tmpdir = tempfile.mkdtemp() self.tmpdir = tempfile.mkdtemp()
self.repository_path = os.path.join(self.tmpdir, 'repository') self.repository_path = os.path.join(self.tmpdir, 'repository')

View file

@ -17,6 +17,7 @@ from .archiver import changedir, cmd
def repo_url(request, tmpdir): def repo_url(request, tmpdir):
os.environ['BORG_PASSPHRASE'] = '123456' os.environ['BORG_PASSPHRASE'] = '123456'
os.environ['BORG_CHECK_I_KNOW_WHAT_I_AM_DOING'] = '1' os.environ['BORG_CHECK_I_KNOW_WHAT_I_AM_DOING'] = '1'
os.environ['BORG_DELETE_I_KNOW_WHAT_I_AM_DOING'] = '1'
os.environ['BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK'] = '1' os.environ['BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK'] = '1'
os.environ['BORG_KEYS_DIR'] = str(tmpdir.join('keys')) os.environ['BORG_KEYS_DIR'] = str(tmpdir.join('keys'))
os.environ['BORG_CACHE_DIR'] = str(tmpdir.join('cache')) os.environ['BORG_CACHE_DIR'] = str(tmpdir.join('cache'))

View file

@ -72,6 +72,8 @@ Some "yes" sayers (if set, they automatically confirm that you really want to do
For "Warning: The repository at location ... was previously located at ..." For "Warning: The repository at location ... was previously located at ..."
BORG_CHECK_I_KNOW_WHAT_I_AM_DOING BORG_CHECK_I_KNOW_WHAT_I_AM_DOING
For "Warning: 'check --repair' is an experimental feature that might result in data loss." For "Warning: 'check --repair' is an experimental feature that might result in data loss."
BORG_DELETE_I_KNOW_WHAT_I_AM_DOING
For "You requested to completely DELETE the repository *including* all archives it contains: "
Directories: Directories:
BORG_KEYS_DIR BORG_KEYS_DIR