CORD-705: Structured logs for ELK
Change-Id: I2bef38d32ad562322f49d6c50d6c54c47b81688c
diff --git a/xos/synchronizers/base/SyncInstanceUsingAnsible.py b/xos/synchronizers/base/SyncInstanceUsingAnsible.py
index 04ea974..f5ce1a6 100644
--- a/xos/synchronizers/base/SyncInstanceUsingAnsible.py
+++ b/xos/synchronizers/base/SyncInstanceUsingAnsible.py
@@ -61,7 +61,7 @@
if not template_name:
template_name = self.template_name
tStart = time.time()
- run_template_ssh(template_name, fields)
+ run_template_ssh(template_name, fields, object=o)
logger.info("playbook execution time %d" % int(time.time()-tStart),extra=o.tologdict())
def pre_sync_hook(self, o, fields):
diff --git a/xos/synchronizers/base/syncstep.py b/xos/synchronizers/base/syncstep.py
index 705025a..6bd4109 100644
--- a/xos/synchronizers/base/syncstep.py
+++ b/xos/synchronizers/base/syncstep.py
@@ -160,7 +160,7 @@
main_objs=main_objs[0]
path = ''.join(main_objs.__name__).lower()
- res = run_template(self.playbook,tenant_fields,path=path)
+ res = run_template(self.playbook,tenant_fields,path=path, object=o)
if hasattr(self, "map_sync_outputs"):
self.map_sync_outputs(o,res)
diff --git a/xos/synchronizers/onboarding/steps/sync_servicecontroller.py b/xos/synchronizers/onboarding/steps/sync_servicecontroller.py
index 4179f4e..b120dce 100644
--- a/xos/synchronizers/onboarding/steps/sync_servicecontroller.py
+++ b/xos/synchronizers/onboarding/steps/sync_servicecontroller.py
@@ -47,7 +47,7 @@
"ansible_tag": sc.__class__.__name__ + "_" + str(sc.id)}
path="servicecontroller"
- res = run_template(self.playbook, tenant_fields, path=path)
+ res = run_template(self.playbook, tenant_fields, path=path, object=sc)
def delete_record(self, m):
pass
diff --git a/xos/synchronizers/onboarding/steps/sync_xos.py b/xos/synchronizers/onboarding/steps/sync_xos.py
index a0b6993..60f5d74 100644
--- a/xos/synchronizers/onboarding/steps/sync_xos.py
+++ b/xos/synchronizers/onboarding/steps/sync_xos.py
@@ -59,7 +59,7 @@
"ansible_tag": xos.__class__.__name__ + "_" + str(xos.id)}
path="XOS"
- res = run_template(self.playbook, tenant_fields, path=path)
+ res = run_template(self.playbook, tenant_fields, path=path, object=xos)
def delete_record(self, m):
pass