diff --git a/TODO b/TODO index 3af93b9a..5fd9c0cf 100644 --- a/TODO +++ b/TODO @@ -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 \ No newline at end of file diff --git a/confluent_server/confluent/core.py b/confluent_server/confluent/core.py index 8a057912..da12f4ed 100644 --- a/confluent_server/confluent/core.py +++ b/confluent_server/confluent/core.py @@ -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):