Comment 9 for bug 1728751

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/37018
Committed: http://github.com/Juniper/contrail-server-manager/commit/d976e212306fee2e3aacc4a6a5386088bcad938c
Submitter: Zuul (<email address hidden>)
Branch: R4.1

commit d976e212306fee2e3aacc4a6a5386088bcad938c
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: I846ba490fe0f1129181eae348721a1df6d35d6af
Closes-bug: #1728751