mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Use ZMQ_VERSION_INFO constant everywhere
This commit is contained in:
parent
43b5558b82
commit
ab5fa34d7c
3 changed files with 4 additions and 23 deletions
|
@ -28,7 +28,7 @@ except ImportError:
|
|||
# pylint: disable=import-error,no-name-in-module,redefined-builtin
|
||||
import salt.ext.six as six
|
||||
from salt.ext.six.moves import range
|
||||
from salt.utils.zeromq import zmq, ZMQDefaultLoop, install_zmq, zmq_version_info
|
||||
from salt.utils.zeromq import zmq, ZMQDefaultLoop, install_zmq, ZMQ_VERSION_INFO
|
||||
# pylint: enable=import-error,no-name-in-module,redefined-builtin
|
||||
|
||||
import tornado.gen # pylint: disable=F0401
|
||||
|
@ -364,7 +364,7 @@ class Master(SMaster):
|
|||
|
||||
:param dict: The salt options
|
||||
'''
|
||||
if zmq and zmq_version_info < (3, 2):
|
||||
if zmq and ZMQ_VERSION_INFO < (3, 2):
|
||||
log.warning(
|
||||
'You have a version of ZMQ less than ZMQ 3.2! There are '
|
||||
'known connection keep-alive issues with ZMQ < 3.2 which '
|
||||
|
|
|
@ -30,7 +30,7 @@ if six.PY3:
|
|||
else:
|
||||
import salt.ext.ipaddress as ipaddress
|
||||
from salt.ext.six.moves import range
|
||||
from salt.utils.zeromq import zmq, ZMQDefaultLoop, install_zmq
|
||||
from salt.utils.zeromq import zmq, ZMQDefaultLoop, install_zmq, ZMQ_VERSION_INFO
|
||||
|
||||
# pylint: enable=no-name-in-module,redefined-builtin
|
||||
from salt.utils.async import LOOP_CLASS
|
||||
|
@ -946,15 +946,7 @@ class Minion(MinionBase):
|
|||
|
||||
# Warn if ZMQ < 3.2
|
||||
if zmq:
|
||||
try:
|
||||
zmq_version_info = zmq.zmq_version_info()
|
||||
except AttributeError:
|
||||
# PyZMQ <= 2.1.9 does not have zmq_version_info, fall back to
|
||||
# using zmq.zmq_version() and build a version info tuple.
|
||||
zmq_version_info = tuple(
|
||||
[int(x) for x in zmq.zmq_version().split('.')] # pylint: disable=no-member
|
||||
)
|
||||
if zmq_version_info < (3, 2):
|
||||
if ZMQ_VERSION_INFO < (3, 2):
|
||||
log.warning(
|
||||
'You have a version of ZMQ less than ZMQ 3.2! There are '
|
||||
'known connection keep-alive issues with ZMQ < 3.2 which '
|
||||
|
|
|
@ -41,17 +41,6 @@ if ZMQDefaultLoop is None:
|
|||
if ZMQDefaultLoop is None:
|
||||
ZMQDefaultLoop = tornado.ioloop.IOLoop
|
||||
|
||||
# Build version info
|
||||
if zmq:
|
||||
if hasattr(zmq, 'zmq_version_info'):
|
||||
zmq_version_info = zmq.zmq_version_info()
|
||||
else:
|
||||
# PyZMQ <= 2.1.9 does not have zmq_version_info, fall back to
|
||||
# using zmq.zmq_version() and build a version info tuple.
|
||||
zmq_version_info = tuple([int(v_el) for v_el in zmq.zmq_version().split('.')])
|
||||
else:
|
||||
zmq_version_info = (-1, -1, -1)
|
||||
|
||||
|
||||
def install_zmq():
|
||||
'''
|
||||
|
|
Loading…
Add table
Reference in a new issue