Validate status attribute

This commit is contained in:
Peter Mosmans 2017-11-10 17:21:10 +10:00
parent 18ba296667
commit 14ba7dec17

View File

@ -333,6 +333,11 @@ def validate_type(tree, filename, options):
root.attrib[attribute]))
root.attrib[attribute] = titlecase(root.attrib[attribute], callback=abbreviations)
fix = True
if attribute == 'status' and root.attrib[attribute] not in \
('new', 'unresolved', 'not_retested', 'resolved'):
print('[-] status ({0}) should be one of: new, unresolved, not_retested or resolved: {1}'.
format(root.attrib[attribute], filename))
result = False
for tag in tags:
if root.find(tag) is None:
logging.warning('Missing tag in %s: %s', filename, tag)