SM logging should work even when cluster_id is not found in inventory
SM Logging infra requires the cluster_id for logging cluster specific logging.
For this purpose, the cluster_id is inserted into the inventory. But for ansible
plays that involve only "localhost", the inv.get_hosts() function returns an
empty list. So the host specific variable retrieval fails. Now always using the
first entry of the host_vars dictionary to retrieve the cluster_id.
Also, adding some defensive checks for cluster_id in the PlayLogger class.
Reviewed: https:/ /review. opencontrail. org/37018 github. com/Juniper/ contrail- server- manager/ commit/ d976e212306fee2 e3aacc4a6a53860 88bcad938c
Committed: http://
Submitter: Zuul (<email address hidden>)
Branch: R4.1
commit d976e212306fee2 e3aacc4a6a53860 88bcad938c
Author: Ramprakash Ram Mohan <email address hidden>
Date: Tue Oct 31 08:25:05 2017 -0700
SM logging should work even when cluster_id is not found in inventory
SM Logging infra requires the cluster_id for logging cluster specific logging.
For this purpose, the cluster_id is inserted into the inventory. But for ansible
plays that involve only "localhost", the inv.get_hosts() function returns an
empty list. So the host specific variable retrieval fails. Now always using the
first entry of the host_vars dictionary to retrieve the cluster_id.
Also, adding some defensive checks for cluster_id in the PlayLogger class.
Change-Id: I846ba490fe0f11 29181eae348721a 1df6d35d6af
Closes-bug: #1728751