Skip to content

Commit

Permalink
disc_server.py: remove hardcoded IP-address
Browse files Browse the repository at this point in the history
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 <martin@millnert.se>
(cherry picked from commit 7924b21)
  • Loading branch information
Millnert authored and eonpatapon committed Feb 25, 2016
1 parent c6a8847 commit 4f0023d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/discovery/disc_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def __init__(self, args):
node_type_name = NodeTypeNames[node_type]
instance_id = self._args.worker_id
disc_client = discovery_client.DiscoveryClient(
'127.0.0.1', self._args.listen_port,
self._args.listen_ip_addr, self._args.listen_port,
ModuleNames[Module.DISCOVERY_SERVICE])
self._sandesh.init_generator(
module_name, socket.gethostname(), node_type_name, instance_id,
Expand Down

0 comments on commit 4f0023d

Please sign in to comment.