discovery server has hardcoded '127.0.0.1'

Bug #1531214 reported by Martin Millnert
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R2.21.x
Fix Committed
Undecided
Unassigned
Trunk
Fix Committed
Undecided
Unassigned

Bug Description

Closely related to bug https://bugs.launchpad.net/juniperopenstack/+bug/1463599 , disc_server.py at https://github.com/Juniper/contrail-controller/blob/master/src/discovery/disc_server.py#L192 still connects to self on 127.0.0.1, hardcoded.

In a setup where the socket is bound to listen on another address, this doesn't work. Discovery can't connect to itself.

Attaching a proposed fix that just uses the configured address instead, which, in line discussion in #1463599 and with its default value set at https://github.com/Juniper/contrail-controller/blob/master/src/discovery/disc_server.py#L1222 , defined at from https://github.com/Juniper/contrail-controller/blob/master/src/discovery/disc_consts.py#L5

Therefore, the default value following this patch remains '127.0.0.1', not based on hardcoded parameters in the code, but because of configuration defaults.

information type: Proprietary → Public
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/16090
Submitter: Martin Millnert (<email address hidden>)

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

Reviewed: https://review.opencontrail.org/16090
Committed: http://github.org/Juniper/contrail-controller/commit/7924b210aca98d77a82f1ac7a58ffc9a7395718a
Submitter: Zuul
Branch: master

commit 7924b210aca98d77a82f1ac7a58ffc9a7395718a
Author: Martin Millnert <email address hidden>
Date: Tue Jan 5 18:14:23 2016 +0100

disc_server.py: remove hardcoded IP-address

src/discovery/disc_server.py has a hardcoded IP address
(127.0.0.1) in its "connect-to-self" code.

The Discovery Server can bind to a configurable port number, so this is
simply a forgotten variable. Without this change, it is impossible to
operate a Discovery Server that has bound to another IP address than
127.0.0.1.

The default value in self._args.listen_ip_addr is populated by the
parameter "_WEB_HOST" in src/discovery/disc_consts.py:5.
The default value of this parameter is '127.0.0.1'.

The change has therefore no impact on a Discovery Server with standard
configuration.

Change-Id: Ibd6a7ddd31a462f240c2358d657e5d384a5bd3ed
Closes-Bug: #1531214
Signed-off-by: Martin Millnert <email address hidden>

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R2.21.x

Review in progress for https://review.opencontrail.org/17842
Submitter: Jean-Philippe Braun (<email address hidden>)

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

Reviewed: https://review.opencontrail.org/17842
Committed: http://github.org/Juniper/contrail-controller/commit/4f0023d5a21f00536b2a2e6097ab9a07b6c13d1a
Submitter: Zuul
Branch: R2.21.x

commit 4f0023d5a21f00536b2a2e6097ab9a07b6c13d1a
Author: Martin Millnert <email address hidden>
Date: Tue Jan 5 18:14:23 2016 +0100

disc_server.py: remove hardcoded IP-address

src/discovery/disc_server.py has a hardcoded IP address
(127.0.0.1) in its "connect-to-self" code.

The Discovery Server can bind to a configurable port number, so this is
simply a forgotten variable. Without this change, it is impossible to
operate a Discovery Server that has bound to another IP address than
127.0.0.1.

The default value in self._args.listen_ip_addr is populated by the
parameter "_WEB_HOST" in src/discovery/disc_consts.py:5.
The default value of this parameter is '127.0.0.1'.

The change has therefore no impact on a Discovery Server with standard
configuration.

Change-Id: Ibd6a7ddd31a462f240c2358d657e5d384a5bd3ed
Closes-Bug: #1531214
Signed-off-by: Martin Millnert <email address hidden>
(cherry picked from commit 7924b210aca98d77a82f1ac7a58ffc9a7395718a)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.