diff --git a/pymisp/data/describeTypes.json b/pymisp/data/describeTypes.json index 823f641..e9b0c00 100644 --- a/pymisp/data/describeTypes.json +++ b/pymisp/data/describeTypes.json @@ -69,6 +69,10 @@ "default_category": "Payload delivery", "to_ids": 1 }, + "float": { + "default_category": "Other", + "to_ids": 0 + }, "url": { "default_category": "External analysis", "to_ids": 1 @@ -544,6 +548,7 @@ "email-dst", "email-subject", "email-attachment", + "float", "url", "http-method", "user-agent", @@ -998,14 +1003,15 @@ "other" ], "Other": [ + "comment", + "text", + "other", "size-in-bytes", "counter", "datetime", "cpe", "port", - "comment", - "text", - "other" + "float" ] } } diff --git a/pymisp/mispevent.py b/pymisp/mispevent.py index 14ae16a..bbfbe3a 100644 --- a/pymisp/mispevent.py +++ b/pymisp/mispevent.py @@ -130,9 +130,9 @@ class MISPAttribute(object): type_defaults = self.sane_default[self.type] - if kwargs.get('value'): - self.value = kwargs['value'] - elif not self.value: + self.value = kwargs.get('value') + + if self.value is None: raise NewAttributeError('The value of the attribute is required.') # Default values @@ -444,7 +444,7 @@ class MISPEvent(object): raise NewEventError('{} is invalid, the analysis has to be in 0, 1, 2'.format(self.analysis)) if kwargs.get('published') is not None: self.unpublish() - if kwargs.get("published") == True: + if kwargs.get("published") is True: self.publish() if kwargs.get('date'): self.set_date(kwargs['date'])