Merge "don't mark deleted if alarm or edge already marked"

This commit is contained in:
Zuul 2018-06-21 13:24:14 +00:00 committed by Gerrit Code Review
commit 665694cd88

View File

@ -50,10 +50,14 @@ def is_deleted(item):
def mark_deleted(g, item): def mark_deleted(g, item):
if isinstance(item, Vertex): if isinstance(item, Vertex):
if item.get(VProps.VITRAGE_IS_DELETED, False):
return
item[VProps.VITRAGE_IS_DELETED] = True item[VProps.VITRAGE_IS_DELETED] = True
item[VProps.VITRAGE_SAMPLE_TIMESTAMP] = str(utcnow()) item[VProps.VITRAGE_SAMPLE_TIMESTAMP] = str(utcnow())
g.update_vertex(item) g.update_vertex(item)
elif isinstance(item, Edge): elif isinstance(item, Edge):
if item.get(EProps.VITRAGE_IS_DELETED, False):
return
item[EProps.VITRAGE_IS_DELETED] = True item[EProps.VITRAGE_IS_DELETED] = True
item[EProps.UPDATE_TIMESTAMP] = str(utcnow()) item[EProps.UPDATE_TIMESTAMP] = str(utcnow())
g.update_edge(item) g.update_edge(item)