Use utility for ZMQ import handling in SSH client

This commit is contained in:
Bo Maryniuk 2018-02-13 14:21:56 +01:00
parent 457ef7d9a5
commit 05f4d40269

View file

@ -56,11 +56,7 @@ try:
HAS_WINSHELL = True
except ImportError:
HAS_WINSHELL = False
try:
import zmq
HAS_ZMQ = True
except ImportError:
HAS_ZMQ = False
from salt.utils.zeromq import zmq
# The directory where salt thin is deployed
DEFAULT_THIN_DIR = '/var/tmp/.%%USER%%_%%FQDNUUID%%_salt'
@ -207,7 +203,7 @@ class SSH(object):
'''
def __init__(self, opts):
pull_sock = os.path.join(opts['sock_dir'], 'master_event_pull.ipc')
if os.path.isfile(pull_sock) and HAS_ZMQ:
if os.path.exists(pull_sock) and zmq:
self.event = salt.utils.event.get_event(
'master',
opts['sock_dir'],