2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-28 20:39:40 +00:00

Fix core to return invalidargument exception on bad input data

This commit is contained in:
Jarrod Johnson 2014-05-08 14:39:44 -04:00
parent 6c7aaf8bc3
commit 2863c58264
2 changed files with 10 additions and 3 deletions

1
TODO
View File

@ -31,3 +31,4 @@ KeyError: ''
a titlebar
-audit log did not show confetty activity for starting console
-read exclusive and full exclusive console access modes
-invalid attributes at create time come out as 500

View File

@ -233,7 +233,10 @@ def create_group(inputdata, configmanager):
attribmap = {groupname: inputdata}
except KeyError:
raise exc.InvalidArgumentException()
configmanager.add_group_attributes(attribmap)
try:
configmanager.add_group_attributes(attribmap)
except ValueError as e:
raise exc.InvalidArgumentException(str(e))
def create_node(inputdata, configmanager):
@ -242,8 +245,11 @@ def create_node(inputdata, configmanager):
del inputdata['name']
attribmap = {nodename: inputdata}
except KeyError:
raise exc.InvalidArgumentException()
configmanager.add_node_attributes(attribmap)
raise exc.InvalidArgumentException('name not specified')
try:
configmanager.add_node_attributes(attribmap)
except ValueError as e:
raise exc.InvalidArgumentException(str(e))
def enumerate_collections(collections):