Exemplo n.º 1
0
    def handle(self, request, data):
        group_id = self.initial['group_id']
        name = self.initial['name']
        delete_volumes = data['delete_volumes']

        try:
            cinder.group_delete(request, group_id,
                                delete_volumes=delete_volumes)
            message = _('Deleting volume group "%s"') % name
            messages.success(request, message)
            return True

        except Exception:
            redirect = reverse(self.failure_url)
            exceptions.handle(request, _('Errors occurred in deleting group.'),
                              redirect=redirect)
Exemplo n.º 2
0
    def handle(self, request, data):
        group_id = self.initial['group_id']
        name = self.initial['name']
        delete_volumes = data['delete_volumes']

        try:
            cinder.group_delete(request,
                                group_id,
                                delete_volumes=delete_volumes)
            message = _('Deleting volume group "%s"') % name
            messages.success(request, message)
            return True

        except Exception:
            redirect = reverse("horizon:project:volume_groups:index")
            exceptions.handle(request,
                              _('Errors occurred in deleting group.'),
                              redirect=redirect)