Skip to content
Snippets Groups Projects
Commit b95b7c89 authored by jkerdreu's avatar jkerdreu
Browse files

Added wrong dev_type type (Py2 default str is bytes[])

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@2501 b32b6428-25c9-4566-ad07-03861ab6144f
parent 39defcd1
No related branches found
No related tags found
No related merge requests found
......@@ -145,6 +145,8 @@ class MessageFactory(object):
# Sanity check incomming message
if not tools.is_valid_address(msg.source):
raise MessageParserError("Wrong message source [%s]" % msg.source)
if not tools.is_valid_dev_type(msg.dev_type):
raise MessageParserError("Wrong message dev_type [%s]" % msg.dev_type)
return msg
#####################################################
......
......@@ -91,14 +91,14 @@ def bytes_to_uuid(val):
return None
def is_valid_uuid(val):
if isinstance(val,UUID):
return True
return False
return isinstance(val,UUID)
def is_valid_address(val):
return is_valid_uuid(val)
def is_valid_dev_type(val):
if not isinstance(val,str):
return False
if re.match(XAAL_DEVTYPE_PATTERN,val):
return True
return False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment