mongo: remove _id in inserted alarm changes

This change ensures that mongodb driver doesn't modify the alarm changes
dictionary when we insert a new alarm changes. To avoid the insertion
of the internal '_id' of mongodb.

Change-Id: I9bcd643c9dc55449141cee94ef6826784e81e4e5
This commit is contained in:
Mehdi Abaakouk 2014-05-09 18:50:48 +02:00
parent 36269031a7
commit aa8d3c0d39

View File

@ -238,7 +238,7 @@ class Connection(base.Connection):
def record_alarm_change(self, alarm_change):
"""Record alarm change event.
"""
self.db.alarm_history.insert(alarm_change)
self.db.alarm_history.insert(alarm_change.copy())
def get_samples(self, sample_filter, limit=None):
"""Return an iterable of model.Sample instances.