fix: [feed-generator] keeping function compatibility

pull/809/head
Christophe Vandeplas 2021-11-29 16:26:57 +01:00
parent 79f4107b7f
commit dd5b448760
1 changed files with 3 additions and 3 deletions

View File

@ -344,7 +344,7 @@ class MISPAttribute(AbstractMISP):
if not hasattr(self, 'timestamp'):
self.timestamp = datetime.timestamp(datetime.now())
def _to_feed(self, with_distribution = True) -> Dict:
def _to_feed(self, with_distribution = False) -> Dict:
if with_distribution:
self._fields_for_feed.add('distribution')
to_return = super()._to_feed()
@ -763,7 +763,7 @@ class MISPObject(AbstractMISP):
if not hasattr(self, 'timestamp'):
self.timestamp = datetime.timestamp(datetime.now())
def _to_feed(self, with_distribution = True) -> Dict:
def _to_feed(self, with_distribution = False) -> Dict:
if with_distribution:
self._fields_for_feed.add('distribution')
to_return = super(MISPObject, self)._to_feed()
@ -1531,7 +1531,7 @@ class MISPEvent(AbstractMISP):
to_return += attribute.hash_values(algorithm)
return to_return
def to_feed(self, valid_distributions: List[int] = [0, 1, 2, 3, 4, 5], with_meta: bool = False, with_distribution = True) -> Dict:
def to_feed(self, valid_distributions: List[int] = [0, 1, 2, 3, 4, 5], with_meta: bool = False, with_distribution = False) -> Dict:
""" Generate a json output for MISP Feed.
:param valid_distributions: only makes sense if the distribution key is set; i.e., the event is exported from a MISP instance.