def handle(self, request, context): url = reverse("horizon:project:network_services:index") try: scnode_id = self.initial['scnode_id'] client.update_servicechain_node( request, scnode_id, **context) msg = _("Service Chain Node Created Successfully!") LOG.debug(msg) return http.HttpResponseRedirect(url) except Exception as e: msg = _("Failed to create Service Chain Node. %s") % (str(e)) LOG.error(msg) exceptions.handle(request, msg, redirect=url)
def handle(self, request, context): url = reverse("horizon:project:network_services:index") try: scnode_id = self.initial['scnode_id'] if context.get('name'): context['name'] = html.escape(context['name']) if context.get('description'): context['description'] = html.escape(context['description']) client.update_servicechain_node(request, scnode_id, **context) msg = _("Service Chain Node Updated Successfully!") LOG.debug(msg) messages.success(request, msg) return http.HttpResponseRedirect(url) except Exception as e: msg = _("Failed to create Service Chain Node. %s") % (str(e)) LOG.error(msg) exceptions.handle(request, msg, redirect=url)
def handle(self, request, context): url = reverse("horizon:project:network_services:index") try: scnode_id = self.initial['scnode_id'] if context.get('name'): context['name'] = html.escape(context['name']) if context.get('description'): context['description'] = html.escape(context['description']) client.update_servicechain_node( request, scnode_id, **context) msg = _("Service Chain Node Updated Successfully!") LOG.debug(msg) messages.success(request, msg) return http.HttpResponseRedirect(url) except Exception as e: msg = _("Failed to create Service Chain Node. %s") % (str(e)) LOG.error(msg) exceptions.handle(request, msg, redirect=url)