Show ZMQ version warning for < 3.2 (rather than < 3)

This commit is contained in:
Colton Myers 2013-09-26 17:39:40 -06:00
parent 723405af5b
commit e53820a982
2 changed files with 15 additions and 11 deletions

View File

@ -168,11 +168,13 @@ class Master(SMaster):
Create a salt master server instance Create a salt master server instance
''' '''
# Warn if ZMQ < 3 # Warn if ZMQ < 3
if int(zmq.zmq_version()[0]) < 3: if (int(zmq.zmq_version()[0]) < 3 or
log.warning('You have a version of ZMQ less than ZMQ 3! There are ' (int(zmq.zmq_version()[0]) == 3 and
'known connection keep-alive issues with ZMQ < 3 ' int(zmq.zmq_version()[2]) < 2)):
'which may result in loss of contact with minions. ' log.warning('You have a version of ZMQ less than ZMQ 3.2! There '
'Please upgrade your ZMQ!') '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) SMaster.__init__(self, opts)
def _clear_old_jobs(self): def _clear_old_jobs(self):

View File

@ -457,12 +457,14 @@ class Minion(object):
''' '''
Pass in the options dict Pass in the options dict
''' '''
# Warn if ZMQ < 3 # Warn if ZMQ < 3.2
if HAS_ZMQ and int(zmq.zmq_version()[0]) < 3: if HAS_ZMQ and (int(zmq.zmq_version()[0]) < 3 or
log.warning('You have a version of ZMQ less than ZMQ 3! There are ' (int(zmq.zmq_version()[0]) == 3 and
'known connection keep-alive issues with ZMQ < 3 ' int(zmq.zmq_version()[2]) < 2)):
'which may result in loss of contact with minions. ' log.warning('You have a version of ZMQ less than ZMQ 3.2! There '
'Please upgrade your ZMQ!') '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 # Late setup the of the opts grains, so we can log from the grains
# module # module
opts['grains'] = salt.loader.grains(opts) opts['grains'] = salt.loader.grains(opts)