From 16ce974d97b99e64bacb1add14832529e37a2572 Mon Sep 17 00:00:00 2001 From: Gevorg Davoian Date: Fri, 9 Sep 2016 00:07:30 +0300 Subject: [PATCH] [zmq] Remove ZmqSocket.close_linger attribute This patch removes unused close_linger attribute. Even if this value will be ever needed, it can always be obtained via getsockopt. Change-Id: I30a6f0876836d77d7cbf700a8035d9341810b959 --- oslo_messaging/_drivers/zmq_driver/zmq_options.py | 2 +- oslo_messaging/_drivers/zmq_driver/zmq_socket.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/oslo_messaging/_drivers/zmq_driver/zmq_options.py b/oslo_messaging/_drivers/zmq_driver/zmq_options.py index e754c86e1..8ab87de46 100644 --- a/oslo_messaging/_drivers/zmq_driver/zmq_options.py +++ b/oslo_messaging/_drivers/zmq_driver/zmq_options.py @@ -56,7 +56,7 @@ zmq_opts = [ help='Name of this node. Must be a valid hostname, FQDN, or ' 'IP address. Must match "host" option, if running Nova.'), - cfg.IntOpt('rpc_zmq_linger', default=-1, + cfg.IntOpt('zmq_linger', default=-1, deprecated_group='DEFAULT', deprecated_name='rpc_cast_timeout', help='Number of seconds to wait before all pending ' diff --git a/oslo_messaging/_drivers/zmq_driver/zmq_socket.py b/oslo_messaging/_drivers/zmq_driver/zmq_socket.py index 0fc3d109f..56a9d35a7 100644 --- a/oslo_messaging/_drivers/zmq_driver/zmq_socket.py +++ b/oslo_messaging/_drivers/zmq_driver/zmq_socket.py @@ -46,12 +46,12 @@ class ZmqSocket(object): self.handle = context.socket(socket_type) self.handle.set_hwm(high_watermark) - self.close_linger = -1 - if self.conf.oslo_messaging_zmq.rpc_zmq_linger >= 0: + # Set linger period + linger = -1 + if self.conf.oslo_messaging_zmq.zmq_linger >= 0: # Convert seconds to milliseconds - self.close_linger = \ - self.conf.oslo_messaging_zmq.rpc_zmq_linger * 1000 - self.handle.setsockopt(zmq.LINGER, self.close_linger) + linger = self.conf.oslo_messaging_zmq.zmq_linger * 1000 + self.handle.setsockopt(zmq.LINGER, linger) # Put messages to only connected queues self.handle.setsockopt(zmq.IMMEDIATE, 1 if immediate else 0)