Description: Fix dependency on zmq when not needed
Author: Thomas Hatch <thatch@saltstack.com>
Origin: https://github.com/saltstack/salt/commit/de4d823b9afdbd1f96735a796a3ecee295b3dcda
Bug: https://github.com/saltstack/salt/issues/12766

--- a/salt/client/ssh/__init__.py
+++ b/salt/client/ssh/__init__.py
@@ -31,6 +31,12 @@
 import salt.exceptions
 import salt.config
 
+try:
+    import zmq
+    HAS_ZMQ = True
+except ImportError:
+    HAS_ZMQ = False
+
 # This is just a delimiter to distinguish the beginning of salt STDOUT.  There
 # is no special meaning
 RSTR = '_edbc7885e4f9aac9b83b35999b68d015148caf467b78fa39c05f669c0ff89878'
@@ -172,11 +178,13 @@
     '''
     def __init__(self, opts):
         self.verify_env()
-        if salt.utils.verify.verify_socket(
-                opts['interface'],
-                opts['publish_port'],
-                opts['ret_port']):
-            self.event = salt.utils.event.MasterEvent(opts['sock_dir'])
+        pull_sock = os.path.join(opts['sock_dir'], 'master_event_pull.ipc')
+        if os.path.isfile(pull_sock) and HAS_ZMQ:
+            self.event = salt.utils.event.get_event(
+                    'master',
+                    opts['sock_dir'],
+                    opts['transport'],
+                    listen=False)
         else:
             self.event = None
         self.opts = opts
