mirror of https://github.com/MISP/PyMISP
Update types, allow 0 as attribute value
parent
e029b60455
commit
638ad3d4b7
pymisp
|
@ -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"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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'])
|
||||
|
|
Loading…
Reference in New Issue