Comment 5 for bug 1463513

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

Reviewed: https://review.opencontrail.org/9567
Committed: http://github.org/Juniper/contrail-packaging/commit/351d7a0938e13b20078dcb9b706f884d4d5c5b09
Submitter: Zuul
Branch: master

commit 351d7a0938e13b20078dcb9b706f884d4d5c5b09
Author: nitishkrishna <email address hidden>
Date: Tue Jun 9 12:32:03 2015 -0700

Closes-Bug: #1463513 - Setting correct interface entries in /etc/hosts for Smgr

This check-in:

- Modifies the setup script to add correct entries to /etc/hosts file
- It handles the three following scenarios

1. /etc/hosts file doesn't have an entry for the interface server manager listens on (Mgmt Interface IP Address)
-> Script adds <hostip> <hostname> entry, given --hostip option
-> Script adds <hostip> <hostname> <hostname>.<domain> entry, given --hostip and --domain options
-> Both scenarios, entry is the first line in /etc/hosts file

2. /etc/hosts file has entry for correct host ip but wrong host name (and domain name)
-> Script adds <hostname> to end of <hostip> line, given --hostip option
-> Script adds <hostname> <hostname>.<domain> to end of <hostip> line, given --hostip and --domain options

3. /etc/hosts file has entry for correct host ip and host name, but is missing domain name
-> Script adds <hostname> <hostname>.<domain> to end of <hostip> line, given --hostip and --domain options

- In the above cases, in single interface scenario, the --hostip option is not needed
- In multi interface, we need to specify the correct interface as --hostip, otherwise ip of eth0/first interface is taken by default

Change-Id: I1c203cd6593702c45db0e8bf4746033da295b129