def handle(self, request, data): replica_id = self.initial['replica_id'] try: replica = manila.share_replica_get(self.request, replica_id) manila.share_replica_resync(request, replica) message = _("Resync'ing replica '%s'") % replica_id messages.success(request, message) return True except Exception: redirect = reverse("horizon:admin:shares:index") exceptions.handle(request, _("Unable to resync replica '%s'.") % replica_id, redirect=redirect)
def handle(self, request, data): replica_id = self.initial['replica_id'] try: replica = manila.share_replica_get(self.request, replica_id) manila.share_replica_resync(request, replica) message = _("Resync'ing replica '%s'") % replica_id messages.success(request, message) return True except Exception: redirect = reverse("horizon:admin:shares:index") exceptions.handle( request, _("Unable to resync replica '%s'.") % replica_id, redirect=redirect)
def test_share_replica_resync(self): api.share_replica_resync(self.request, "fake") self.manilaclient.share_replicas.resync.assert_called_once_with("fake")