Commit 41fb08d6 authored by Andrey Vertiprahov's avatar Andrey Vertiprahov

Merge branch 'fix-avs-object-datastream' into 'master'

Fix object datastream iter_changed managed_object check.

See merge request noc/noc!3143
parents 5d4fd665 7feb997a
......@@ -103,11 +103,19 @@ class Object(Document):
def iter_changed_datastream(self, changed_fields=None):
if config.datastream.enable_managedobject:
if self.data and "management" in self.data:
if (
self.data
and "management" in self.data
and self.data["management"].get("managed_object")
):
yield "managedobject", self.data["management"]["managed_object"]
else:
for _, o, _ in self.iter_outer_connections():
if o.data and "management" in o.data:
if (
o.data
and "management" in o.data
and self.data["management"].get("managed_object")
):
yield "managedobject", o.data["management"]["managed_object"]
def clean(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment