From 457ef7d9a540e94de5c3b2b097205f986605e5a6 Mon Sep 17 00:00:00 2001 From: Bo Maryniuk Date: Tue, 13 Feb 2018 14:21:42 +0100 Subject: [PATCH] Use utility for ZMQ import handling in flo/zero --- salt/daemons/flo/zero.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/salt/daemons/flo/zero.py b/salt/daemons/flo/zero.py index a5a8bec743..c7145e7f30 100644 --- a/salt/daemons/flo/zero.py +++ b/salt/daemons/flo/zero.py @@ -15,15 +15,13 @@ import errno # Import ioflo libs import ioflo.base.deeding # Import third party libs -try: - import zmq - import salt.master - import salt.crypt - import salt.daemons.masterapi - import salt.payload - HAS_ZMQ = True -except ImportError: - HAS_ZMQ = False +from salt.utils.zeromq import zmq +import salt.master +import salt.crypt +import salt.daemons.masterapi +import salt.payload +import salt.utils.stringutils + log = logging.getLogger(__name__) @@ -159,7 +157,7 @@ class SaltZmqPublisher(ioflo.base.deeding.Deed): ''' Set up tracking value(s) ''' - if not HAS_ZMQ: + if not zmq: return self.created = False self.serial = salt.payload.Serial(self.opts.value)