Skip to content

Commit

Permalink
changed source => object / destination => referenced
Browse files Browse the repository at this point in the history
  • Loading branch information
iglocska committed Sep 7, 2017
1 parent 2a5f334 commit b337e77
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pymisp/mispevent.py
Expand Up @@ -638,13 +638,13 @@ def add_attribute(self, type, value, **kwargs):

class MISPObjectReference(AbstractMISP):

attributes = ['source_uuid', 'referenced_uuid', 'relationship_type', 'comment', 'uuid', 'deleted']
attributes = ['object_uuid', 'referenced_uuid', 'relationship_type', 'comment', 'uuid', 'deleted']

def __init__(self):
super(MISPObjectReference, self).__init__()

def from_dict(self, source_uuid, referenced_uuid, relationship_type, comment=None, **kwargs):
self.source_uuid = source_uuid
def from_dict(self, object_uuid, referenced_uuid, relationship_type, comment=None, **kwargs):
self.object_uuid = object_uuid
self.referenced_uuid = referenced_uuid
self.relationship_type = relationship_type
self.comment = comment
Expand Down Expand Up @@ -774,14 +774,14 @@ def _validate(self):

def add_reference(self, referenced_uuid, relationship_type, comment=None, **kwargs):
"""Add a link (uuid) to an other object"""
if kwargs.get('source_uuid'):
if kwargs.get('object_uuid'):
# Load existing object
source_uuid = kwargs.get('source_uuid')
object_uuid = kwargs.get('object_uuid')
else:
# New reference
source_uuid = self.uuid
object_uuid = self.uuid
reference = MISPObjectReference()
reference.from_dict(source_uuid=source_uuid, referenced_uuid=referenced_uuid,
reference.from_dict(object_uuid=object_uuid, referenced_uuid=referenced_uuid,
relationship_type=relationship_type, comment=comment, **kwargs)
self.ObjectReference.append(reference)

Expand Down

0 comments on commit b337e77

Please sign in to comment.