backups: Fix removing local repository

- Remove incorrect instantiation of SSH repository for local disk repositories.

- Clarify the removal message to convey that backups are not removed.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2019-08-27 22:51:15 -07:00 committed by James Valleroy
parent 92abe9f3c1
commit 5136304212
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 4 additions and 5 deletions

View File

@ -317,7 +317,6 @@ class BorgRepository(BaseBorgRepository):
def remove_repository(self):
"""Remove a repository from the kvstore and delete its mountpoint"""
self.umount()
network_storage.delete(self.uuid)

View File

@ -470,16 +470,16 @@ class RemoveRepositoryView(SuccessMessageMixin, TemplateView):
"""Return additional context for rendering the template."""
context = super().get_context_data(**kwargs)
context['title'] = _('Remove Repository')
context['repository'] = SshBorgRepository(uuid=uuid)
context['repository'] = create_repository(uuid)
return context
def post(self, request, uuid):
"""Delete the archive."""
repository = SshBorgRepository(uuid)
"""Delete the repository on confirmation."""
repository = create_repository(uuid)
repository.remove_repository()
messages.success(
request,
_('Repository removed. The remote backup itself was not deleted.'))
_('Repository removed. Backups were not deleted.'))
return redirect('backups:index')