fix: Add support for uuid

pull/3/head
Raphaël Vinot 2018-04-05 11:36:24 +02:00
parent 2ddc9e0d7c
commit 14fadcb3c4
1 changed files with 5 additions and 0 deletions

View File

@ -164,10 +164,13 @@ class ClusterValue():
def __init__(self, v):
if not v['value']:
raise PyMISPGalaxiesError("Invalid cluster (no value): {}".format(v))
self.uuid = v.get('uuid', None)
self.value = v['value']
self.description = v.get('description')
self.meta = self.__init_meta(v.get('meta'))
self.searchable = [self.value]
if self.uuid:
self.searchable.append(self.uuid)
if self.meta and self.meta.synonyms:
self.searchable += self.meta.synonyms
@ -181,6 +184,8 @@ class ClusterValue():
def to_dict(self):
to_return = {'value': self.value}
if self.uuid:
to_return['uuid'] = self.uuid
if self.description:
to_return['description'] = self.description
if self.meta: