From 4e2ba960f9c6b0118616ee70db928f631aabc7d8 Mon Sep 17 00:00:00 2001 From: Shu Muto Date: Fri, 2 Sep 2016 16:33:43 +0900 Subject: [PATCH] Use BadRequest in REST API InvalidAttribute exception is undefined. Instead use BadRequest. Change-Id: I572ae8d0f3d9cfac7e87069bd66fbe33b3cc7202 Closes-Bug: #1619534 --- magnum_ui/api/magnum.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/magnum_ui/api/magnum.py b/magnum_ui/api/magnum.py index 5a885696..844df111 100644 --- a/magnum_ui/api/magnum.py +++ b/magnum_ui/api/magnum.py @@ -72,7 +72,7 @@ def cluster_template_create(request, **kwargs): if key in CLUSTER_TEMPLATE_CREATE_ATTRS: args[str(key)] = str(value) else: - raise exceptions.InvalidAttribute( + raise exceptions.BadRequest( "Key must be in %s" % ",".join(CLUSTER_TEMPLATE_CREATE_ATTRS)) if key == "labels": labels = {} @@ -104,7 +104,7 @@ def cluster_create(request, **kwargs): if key in CLUSTER_CREATE_ATTRS: args[key] = value else: - raise exceptions.InvalidAttribute( + raise exceptions.BadRequest( "Key must be in %s" % ",".join(CLUSTER_CREATE_ATTRS)) return magnumclient(request).bays.create(**args)