Segnalazione #154
Eccezione su cluster
0%
Description
Environment: Request Method: GET Request URL: http://localhost:8000/host/list/paperopoli Django Version: 1.8.4 Python Version: 3.4.2 Installed Applications: ['django.contrib.sessions', 'django.contrib.messages', 'whitenoise.runserver_nostatic', 'django.contrib.staticfiles', 'octonet', 'hostqueue.apps.HostQueue', 'firewall.apps.Firewall', 'dhcp.apps.Dhcp', 'dansguardian.apps.DansGuardian', 'host.apps.Host', 'polygen.apps.Polygen', 'upgrade.apps.Upgrade', 'asterisk.apps.Asterisk', 'samba.apps.Samba', 'users.apps.Users', 'script.apps.Script', 'quota.apps.Quota', 'printers.apps.Printers', 'auth.apps.Auth'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.locale.LocaleMiddleware', 'octonet.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware'] Template error: In template /home/cgabriel/git/fuss/octonet/host/templates/host/list.html, error at line 60 Reverse for 'host_edit' with arguments '()' and keyword arguments '{'name': '/'}' not found. 1 pattern(s) tried: ['host/edit/(?P<name>[^/]+)?$'] 50 : <th>{% trans "Host" %}</th> 51 : <th>{% trans "Logged user" %}</th> 52 : <th>{% trans "Status" %}</th> 53 : <th>{% trans "Screen" %}</th> 54 : <th></th> 55 : </tr> 56 : </thead> 57 : <tbody> 58 : {% for host, info in all_info %} 59 : <tr> 60 : <td><a href=" {% url 'host:host_edit' name=host %} ">{{host}}</a></td> 61 : <td>{{info.logged_user|default:"-"}}</td> 62 : <td> 63 : {% if info.isup %} 64 : <span class="text-success"><span class="fa fa-thumbs-up"></span> {% trans "Up" %}</span> 65 : {% else %} 66 : <span class="text-danger"><span class="fa fa-thumbs-down"></span> {% trans "Down" %}</span> 67 : {% endif %} 68 : </td> 69 : <td> 70 : {% if info.screen_locked %} Traceback: File "/usr/local/lib/python3.4/dist-packages/django/core/handlers/base.py" in get_response 164. response = response.render() File "/usr/local/lib/python3.4/dist-packages/django/template/response.py" in render 158. self.content = self.rendered_content File "/usr/local/lib/python3.4/dist-packages/django/template/response.py" in rendered_content 135. content = template.render(context, self._request) File "/usr/local/lib/python3.4/dist-packages/django/template/backends/django.py" in render 74. return self.template.render(context) File "/usr/local/lib/python3.4/dist-packages/django/template/base.py" in render 209. return self._render(context) File "/usr/local/lib/python3.4/dist-packages/django/template/base.py" in _render 201. return self.nodelist.render(context) File "/usr/local/lib/python3.4/dist-packages/django/template/base.py" in render 903. bit = self.render_node(node, context) File "/usr/local/lib/python3.4/dist-packages/django/template/debug.py" in render_node 79. return node.render(context) File "/usr/local/lib/python3.4/dist-packages/django/template/loader_tags.py" in render 135. return compiled_parent._render(context) File "/usr/local/lib/python3.4/dist-packages/django/template/base.py" in _render 201. return self.nodelist.render(context) File "/usr/local/lib/python3.4/dist-packages/django/template/base.py" in render 903. bit = self.render_node(node, context) File "/usr/local/lib/python3.4/dist-packages/django/template/debug.py" in render_node 79. return node.render(context) File "/usr/local/lib/python3.4/dist-packages/django/template/loader_tags.py" in render 135. return compiled_parent._render(context) File "/usr/local/lib/python3.4/dist-packages/django/template/base.py" in _render 201. return self.nodelist.render(context) File "/usr/local/lib/python3.4/dist-packages/django/template/base.py" in render 903. bit = self.render_node(node, context) File "/usr/local/lib/python3.4/dist-packages/django/template/debug.py" in render_node 79. return node.render(context) File "/usr/local/lib/python3.4/dist-packages/django/template/loader_tags.py" in render 135. return compiled_parent._render(context) File "/usr/local/lib/python3.4/dist-packages/django/template/base.py" in _render 201. return self.nodelist.render(context) File "/usr/local/lib/python3.4/dist-packages/django/template/base.py" in render 903. bit = self.render_node(node, context) File "/usr/local/lib/python3.4/dist-packages/django/template/debug.py" in render_node 79. return node.render(context) File "/usr/local/lib/python3.4/dist-packages/django/template/loader_tags.py" in render 65. result = block.nodelist.render(context) File "/usr/local/lib/python3.4/dist-packages/django/template/base.py" in render 903. bit = self.render_node(node, context) File "/usr/local/lib/python3.4/dist-packages/django/template/debug.py" in render_node 79. return node.render(context) File "/usr/local/lib/python3.4/dist-packages/django/template/loader_tags.py" in render 65. result = block.nodelist.render(context) File "/usr/local/lib/python3.4/dist-packages/django/template/base.py" in render 903. bit = self.render_node(node, context) File "/usr/local/lib/python3.4/dist-packages/django/template/debug.py" in render_node 79. return node.render(context) File "/usr/local/lib/python3.4/dist-packages/django/template/defaulttags.py" in render 329. return nodelist.render(context) File "/usr/local/lib/python3.4/dist-packages/django/template/base.py" in render 903. bit = self.render_node(node, context) File "/usr/local/lib/python3.4/dist-packages/django/template/debug.py" in render_node 79. return node.render(context) File "/usr/local/lib/python3.4/dist-packages/django/template/defaulttags.py" in render 217. nodelist.append(node.render(context)) File "/usr/local/lib/python3.4/dist-packages/django/template/defaulttags.py" in render 507. six.reraise(*exc_info) File "/usr/local/lib/python3.4/dist-packages/django/utils/six.py" in reraise 659. raise value File "/usr/local/lib/python3.4/dist-packages/django/template/defaulttags.py" in render 493. url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app) File "/usr/local/lib/python3.4/dist-packages/django/core/urlresolvers.py" in reverse 579. return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))) File "/usr/local/lib/python3.4/dist-packages/django/core/urlresolvers.py" in _reverse_with_prefix 496. (lookup_view_s, args, kwargs, len(patterns), patterns)) Exception Type: NoReverseMatch at /host/list/paperopoli Exception Value: Reverse for 'host_edit' with arguments '()' and keyword arguments '{'name': '/'}' not found. 1 pattern(s) tried: ['host/edit/(?P<name>[^/]+)?$']
History
Updated by Mark Caglienzi almost 8 years ago
- Status changed from In elaborazione to Commenti
- Assignee changed from Mark Caglienzi to Christopher R. Gabriel
Corretto temporaneamente con un workaround in b53b35e4
Il problema è a monte. Viene permessa la creazione di un host con nome vuoto (#153), e nella view di dettagli cluster un host con nome vuoto viene reso come "/", cosa che fa fallire la regex di edit_host perché per nome prende tutto tranne la '/'.
Probabilmente questo workaround diventerà superfluo una volta che avrò corretto il problema a monte in #153, ma chiedo review e idee in merito, su come gestire al meglio questo problema.
Mergiato e pushato
Updated by Christopher R. Gabriel almost 8 years ago
- Assignee changed from Christopher R. Gabriel to Mark Caglienzi
Ok, verificato.
Non lo considereei temporaneo, il controllo che hai introdotto rafforza la qualita' dei dati in uscita, quindi per me ok, chiudibile, correggere il commento lasciando il riferimento al ticket.
Updated by Mark Caglienzi almost 8 years ago
- Status changed from Commenti to Chiuso
Corretto il commento in 52e380e5
Chiudo.
Temporary workaround. refs #154 #153