Skip to content

Commit

Permalink
Show ZMQ version warning for < 3.2 (rather than < 3)
Browse files Browse the repository at this point in the history
  • Loading branch information
basepi committed Sep 26, 2013
1 parent 763a9b4 commit 60fbb6f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
12 changes: 7 additions & 5 deletions salt/master.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,13 @@ def __init__(self, opts):
Create a salt master server instance
'''
# Warn if ZMQ < 3
if int(zmq.zmq_version()[0]) < 3:
log.warning('You have a version of ZMQ less than ZMQ 3! There are '
'known connection keep-alive issues with ZMQ < 3 '
'which may result in loss of contact with minions. '
'Please upgrade your ZMQ!')
if (int(zmq.zmq_version()[0]) < 3 or
(int(zmq.zmq_version()[0]) == 3 and
int(zmq.zmq_version()[2]) < 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 may result in loss of contact with '
'minions. Please upgrade your ZMQ!')
SMaster.__init__(self, opts)

def _clear_old_jobs(self):
Expand Down
14 changes: 8 additions & 6 deletions salt/minion.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,12 +457,14 @@ def __init__(self, opts, timeout=60, safe=True):
'''
Pass in the options dict
'''
# Warn if ZMQ < 3
if HAS_ZMQ and int(zmq.zmq_version()[0]) < 3:
log.warning('You have a version of ZMQ less than ZMQ 3! There are '
'known connection keep-alive issues with ZMQ < 3 '
'which may result in loss of contact with minions. '
'Please upgrade your ZMQ!')
# Warn if ZMQ < 3.2
if HAS_ZMQ and (int(zmq.zmq_version()[0]) < 3 or
(int(zmq.zmq_version()[0]) == 3 and
int(zmq.zmq_version()[2]) < 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 may result in loss of contact with '
'minions. Please upgrade your ZMQ!')
# Late setup the of the opts grains, so we can log from the grains
# module
opts['grains'] = salt.loader.grains(opts)
Expand Down

0 comments on commit 60fbb6f

Please sign in to comment.