Added type check to alarm definition schema
Change-Id: I4df90a9cbd67ee95be80b061d494fae3bc6e1307
This commit is contained in:
parent
526cc9e3e8
commit
37418ced55
|
@ -34,6 +34,9 @@ def list_item_length(v):
|
|||
if not isinstance(v, list):
|
||||
raise Invalid('Not a list: {}'.format(type(v)))
|
||||
for i in v:
|
||||
if not isinstance(i, (str, unicode)):
|
||||
raise Invalid('list item <{}> -> {} not one of (str, unicode)'
|
||||
.format(i, type(i)))
|
||||
if len(i) > MAX_ITEM_LENGTH:
|
||||
raise Invalid('length {} > {}'.format(len(i), MAX_ITEM_LENGTH))
|
||||
|
||||
|
|
Loading…
Reference in New Issue