diff options
author | Dana Powers <dana.powers@gmail.com> | 2017-04-04 18:07:14 -0700 |
---|---|---|
committer | Dana Powers <dana.powers@gmail.com> | 2017-04-05 23:13:23 -0700 |
commit | 29e699d940df5fa3ae3ee77cc57e9f90da1396c7 (patch) | |
tree | 0d9ed02f39e1d65d3a3bf90db61c41dc16bc2315 | |
parent | 7c24135eaf1db95c50c5d340cd15cbfc2674c927 (diff) | |
download | kafka-python-29e699d940df5fa3ae3ee77cc57e9f90da1396c7.tar.gz |
Move BrokerConnection node_id from config to attribute
-rw-r--r-- | kafka/conn.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kafka/conn.py b/kafka/conn.py index d5b7c50..58ce836 100644 --- a/kafka/conn.py +++ b/kafka/conn.py @@ -177,6 +177,8 @@ class BrokerConnection(object): if key in configs: self.config[key] = configs[key] + self.node_id = self.config.pop('node_id') + if self.config['receive_buffer_bytes'] is not None: self.config['socket_options'].append( (socket.SOL_SOCKET, socket.SO_RCVBUF, @@ -214,7 +216,7 @@ class BrokerConnection(object): if self.config['metrics']: self._sensors = BrokerConnectionMetrics(self.config['metrics'], self.config['metric_group_prefix'], - self.config['node_id']) + self.node_id) def connect(self): """Attempt to connect and return ConnectionState""" @@ -904,7 +906,7 @@ class BrokerConnection(object): def __repr__(self): return "<BrokerConnection node_id=%s host=%s/%s port=%d>" % ( - self.config['node_id'], self.hostname, self.host, self.port) + self.node_id, self.hostname, self.host, self.port) class BrokerConnectionMetrics(object): |