From 99c06813d933edd4ef4207ef928083a9e5a743e7 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 27 Feb 2019 14:58:26 -0500 Subject: [PATCH] Fix clearing validated attributes Attributes that are validated can come in as None to clear them, accept this as valid as well. --- confluent_server/confluent/messages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/messages.py b/confluent_server/confluent/messages.py index 1ece4ab5..90382558 100644 --- a/confluent_server/confluent/messages.py +++ b/confluent_server/confluent/messages.py @@ -619,7 +619,7 @@ class InputAttributes(ConfluentMessage): raise exc.InvalidArgumentException( 'Attribute {0} does not accept value {1} (valid values would be {2})'.format( attr, nodeattr[attr], ','.join(validattrs[attr]['validvalues']))) - elif validattrs and 'validlist' in validattrs.get(attr, []): + elif validattrs and 'validlist' in validattrs.get(attr, []) and nodeattr[attr]: req = nodeattr[attr].split(',') for v in req: if v and v not in validattrs[attr]['validlist']: @@ -628,7 +628,7 @@ class InputAttributes(ConfluentMessage): '{1} (valid values would be {2})'.format( attr, v, ','.join( validattrs[attr]['validlist']))) - elif validattrs and 'validlistkeys' in validattrs.get(attr, []): + elif validattrs and 'validlistkeys' in validattrs.get(attr, []) and nodeattr[attr]: req = nodeattr[attr].split(',') for v in req: if '=' not in v: