Merge "Use BadRequest in REST API"
This commit is contained in:
commit
319253acf1
@ -72,7 +72,7 @@ def cluster_template_create(request, **kwargs):
|
|||||||
if key in CLUSTER_TEMPLATE_CREATE_ATTRS:
|
if key in CLUSTER_TEMPLATE_CREATE_ATTRS:
|
||||||
args[str(key)] = str(value)
|
args[str(key)] = str(value)
|
||||||
else:
|
else:
|
||||||
raise exceptions.InvalidAttribute(
|
raise exceptions.BadRequest(
|
||||||
"Key must be in %s" % ",".join(CLUSTER_TEMPLATE_CREATE_ATTRS))
|
"Key must be in %s" % ",".join(CLUSTER_TEMPLATE_CREATE_ATTRS))
|
||||||
if key == "labels":
|
if key == "labels":
|
||||||
labels = {}
|
labels = {}
|
||||||
@ -104,7 +104,7 @@ def cluster_create(request, **kwargs):
|
|||||||
if key in CLUSTER_CREATE_ATTRS:
|
if key in CLUSTER_CREATE_ATTRS:
|
||||||
args[key] = value
|
args[key] = value
|
||||||
else:
|
else:
|
||||||
raise exceptions.InvalidAttribute(
|
raise exceptions.BadRequest(
|
||||||
"Key must be in %s" % ",".join(CLUSTER_CREATE_ATTRS))
|
"Key must be in %s" % ",".join(CLUSTER_CREATE_ATTRS))
|
||||||
return magnumclient(request).bays.create(**args)
|
return magnumclient(request).bays.create(**args)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user