From 85669abbcbd18178c8b7745ffc649bdf4eed3481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 24 Oct 2017 08:52:00 -0400 Subject: [PATCH] chg: Do not raise an exception when the object template is unknown. + bump misp-object --- pymisp/data/misp-objects | 2 +- pymisp/mispevent.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pymisp/data/misp-objects b/pymisp/data/misp-objects index b801bc6..bbf3e45 160000 --- a/pymisp/data/misp-objects +++ b/pymisp/data/misp-objects @@ -1 +1 @@ -Subproject commit b801bc6603c9ba9f6bec5b5868ae26b89a11d862 +Subproject commit bbf3e45649af5af50c98ad90a86916cf75e8c74d diff --git a/pymisp/mispevent.py b/pymisp/mispevent.py index 0e99ed2..f00c5cf 100644 --- a/pymisp/mispevent.py +++ b/pymisp/mispevent.py @@ -603,7 +603,7 @@ class MISPObjectAttribute(MISPAttribute): class MISPObject(AbstractMISP): - def __init__(self, name, strict=True): + def __init__(self, name, strict=False): super(MISPObject, self).__init__() self.__strict = strict self.name = name @@ -639,7 +639,7 @@ class MISPObject(AbstractMISP): else: self.__known_template = False if kwargs.get('template_version') and int(kwargs['template_version']) != self.template_version: - if self.strict: + if self.__strict: raise UnknownMISPObjectTemplate('Version of the object ({}) is different from the one of the template ({}).'.format(kwargs['template_version'], self.template_version)) else: self.__known_template = False @@ -654,12 +654,12 @@ class MISPObject(AbstractMISP): else: setattr(self, key, value) - def to_dict(self, strict=True): + def to_dict(self, strict=False): if strict or self.__strict and self.__known_template: self._validate() return super(MISPObject, self).to_dict() - def to_json(self, strict=True): + def to_json(self, strict=False): if strict or self.__strict and self.__known_template: self._validate() return super(MISPObject, self).to_json()