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
Reviewed: https:/ /review. opencontrail. org/9567 github. org/Juniper/ contrail- packaging/ commit/ 351d7a0938e13b2 0078dcb9b706f88 4d4d5c5b09
Committed: http://
Submitter: Zuul
Branch: master
commit 351d7a0938e13b2 0078dcb9b706f88 4d4d5c5b09
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: I1c203cd6593702 c45db0e8bf47460 33da295b129