示例#1
0
    def handle(self, request, data):
        qos_spec_id = self.initial["qos_spec_id"]
        new_consumer = data["consumer_choice"]

        # Update QOS Spec consumer information
        try:
            cinder.qos_spec_set_keys(request, qos_spec_id, {"consumer": new_consumer})
            messages.success(request, _("Successfully modified QoS Spec consumer."))
            return True
        except Exception:
            exceptions.handle(request, _("Error editing QoS Spec consumer."))
            return False
示例#2
0
    def handle(self, request, data):
        qos_spec_id = self.initial['qos_spec_id']
        new_consumer = data['consumer_choice']

        # Update QOS Spec consumer information
        try:
            cinder.qos_spec_set_keys(request, qos_spec_id,
                                     {'consumer': new_consumer})
            messages.success(request,
                             _('Successfully modified QoS Spec consumer.'))
            return True
        except Exception:
            exceptions.handle(request, _('Error editing QoS Spec consumer.'))
            return False
示例#3
0
文件: forms.py 项目: 308576950/test
    def handle(self, request, data):
        qos_spec_id = self.initial['qos_spec_id']
        new_consumer = data['consumer_choice']

        # Update QOS Spec consumer information
        try:
            cinder.qos_spec_set_keys(request,
                                     qos_spec_id,
                                     {'consumer': new_consumer})
            messages.success(request,
                             _('Successfully modified QOS Spec consumer.'))
            return True
        except Exception:
            exceptions.handle(request, _('Error editing QOS Spec consumer.'))
            return False
示例#4
0
    def handle(self, request, data):
        qos_spec_id = self.initial['qos_spec_id']
        new_consumer = data['consumer_choice']

        # Update QOS Spec consumer information
        try:
            cinder.qos_spec_set_keys(request,
                                     qos_spec_id,
                                     {'consumer': new_consumer})
            messages.success(request,
                             _('Successfully modified QoS Spec consumer.'))
            return True
        except Exception:
            redirect = reverse("horizon:admin:volume_types:index")
            exceptions.handle(request, _('Error editing QoS Spec consumer.'),
                              redirect=redirect)
示例#5
0
    def handle(self, request, data):
        qos_spec_id = self.initial['qos_spec_id']
        new_consumer = data['consumer_choice']

        # Update QOS Spec consumer information
        try:
            cinder.qos_spec_set_keys(request,
                                     qos_spec_id,
                                     {'consumer': new_consumer})
            messages.success(request,
                             _('Successfully modified QoS Spec consumer.'))
            return True
        except Exception:
            redirect = reverse("horizon:admin:volumes:index")
            exceptions.handle(request, _('Error editing QoS Spec consumer.'),
                              redirect=redirect)