Update yeti.py

add check
pull/488/head
Sebdraven 2021-04-19 11:24:01 +02:00
parent 4634567b23
commit a29779eff6
1 changed files with 9 additions and 2 deletions

View File

@ -100,9 +100,16 @@ class Yeti():
obj_to_add['type'] in ('Hostname', 'Domain', 'Ip') and self.attribute['type'] == 'url'
):
url_object = MISPObject('Url')
url_object.add_attribute(self.__get_relation(obj_to_add), obj_to_add['value'])
url_object.add_attribute(self.__get_relation(self.attribute),
obj_relation = self.__get_relation(obj_to_add)
if obj_relation:
print(obj_relation)
url_object.add_attribute(self.__get_relation(obj_to_add), obj_to_add['value'])
obj_relation = self.__get_relation(self.attribute)
if obj_relation:
print(obj_relation)
url_object.add_attribute(self.__get_relation(self.attribute),
self.attribute['value'])
url_object.add_reference(self.attribute['uuid'], 'related_to')
print(url_object)
return url_object