p.view_node(): check node_id for validity, before sending it to the API

This prevents a pillarsdk.exceptions.MethodNotAllowed exception, which
would result in a 500 Internal Server Error on the frontend.
This commit is contained in:
2016-08-24 14:49:30 +02:00
parent b6c623cca8
commit 04c9c010f0
5 changed files with 73 additions and 0 deletions

View File

@@ -322,6 +322,9 @@ def view_node(project_url, node_id):
node_id=node_id[1:]),
code=301) # permanent redirect
if not utils.is_valid_id(node_id):
raise wz_exceptions.NotFound('No such node')
api = system_util.pillar_api()
theatre_mode = 't' in request.args