Skip to content

Commit

Permalink
[BUG] Fixed xys
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrien Delle Cave committed Oct 2, 2018
1 parent 3826231 commit f87e789
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from setuptools import find_packages, setup

requirements = [line.strip() for line in open('requirements.txt', 'r').readlines()]
version = '0.2.57'
version = '0.2.58'

if os.path.isfile('VERSION'):
version = open('VERSION', 'r').readline().strip() or version
Expand Down
8 changes: 7 additions & 1 deletion sonicprobe/libs/xys.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,9 @@ def validate(document, schema, log_qualifier = True):
LOG.error("forbidden key %s in document", key)
return False
elif optionalnull.has_key(key) and doc_val is None:
return True
continue
elif schema_val.min_len == 0 and doc_val is "":
continue

if schema_val.modifier:
for modname in schema_val.modifier:
Expand All @@ -783,6 +785,10 @@ def validate(document, schema, log_qualifier = True):
elif hasattr(doc_val, modname):
document[key] = getattr(document[key], modname)()
doc_val = getattr(doc_val, modname)()
if optionalnull.has_key(key) and doc_val is None:
continue
elif schema_val.min_len == 0 and doc_val is "":
continue

if _valid_len(key, doc_val, schema_val.min_len, schema_val.max_len) is False:
return False
Expand Down

0 comments on commit f87e789

Please sign in to comment.