def zmq_version():
 try:
  import zmq
 except Exception:
  return True
 ver = zmq.__version__
 match = re.match('^(\\d+)\\.(\\d+)(?:\\.(\\d+))?', ver)
 if (not match):
  msg = "Using untested zmq python bindings version: '{0}'".format(ver)
  if is_console_configured():
   log.warning(msg)
  else:
   sys.stderr.write('WARNING {0}\n'.format(msg))
  return True
 (major, minor, point) = match.groups()
 if major.isdigit():
  major = int(major)
 if minor.isdigit():
  minor = int(minor)
 if (point and point.isdigit()):
  point = int(point)
 if ((major == 2) and (minor == 1)):
  if (('dev' in ver) and (not point)):
   msg = 'Using dev zmq module, please report unexpected results'
   if is_console_configured():
    log.warning(msg)
   else:
    sys.stderr.write('WARNING: {0}\n'.format(msg))
   return True
  elif (point and (point >= 9)):
   return True
 elif ((major > 2) or ((major == 2) and (minor > 1))):
  return True
 log.critical('ZeroMQ python bindings >= 2.1.9 are required')
 if ('salt-master' in sys.argv[0]):
  msg = 'The Salt Master is unstable using a ZeroMQ version lower than 2.1.11 and requires this fix: http://lists.zeromq.org/pipermail/zeromq-dev/2011-June/012094.html'
  if is_console_configured():
   log.critical(msg)
  else:
   sys.stderr.write('CRITICAL {0}\n'.format(msg))
 return False

def zmq_version ( ) : try : import zmq except Exception : return True ver = zmq . __version__ match = re . match ( '^(\\d+)\\.(\\d+)(?:\\.(\\d+))?' , ver ) if ( not match ) : msg = "Using untested zmq python bindings version: '{0}'" . format ( ver ) if is_console_configured ( ) : log . warning ( msg ) else : sys . stderr . write ( 'WARNING {0}\n' . format ( msg ) ) return True ( major , minor , point ) = match . groups ( ) if major . isdigit ( ) : major = int ( major ) if minor . isdigit ( ) : minor = int ( minor ) if ( point and point . isdigit ( ) ) : point = int ( point ) if ( ( major == 2 ) and ( minor == 1 ) ) : if ( ( 'dev' in ver ) and ( not point ) ) : msg = 'Using dev zmq module, please report unexpected results' if is_console_configured ( ) : log . warning ( msg ) else : sys . stderr . write ( 'WARNING: {0}\n' . format ( msg ) ) return True elif ( point and ( point >= 9 ) ) : return True elif ( ( major > 2 ) or ( ( major == 2 ) and ( minor > 1 ) ) ) : return True log . critical ( 'ZeroMQ python bindings >= 2.1.9 are required' ) if ( 'salt-master' in sys . argv [ 0 ] ) : msg = 'The Salt Master is unstable using a ZeroMQ version lower than 2.1.11 and requires this fix: http://lists.zeromq.org/pipermail/zeromq-dev/2011-June/012094.html' if is_console_configured ( ) : log . critical ( msg ) else : sys . stderr . write ( 'CRITICAL {0}\n' . format ( msg ) ) return False
return the version of libzmq as a string .