No need to manually do connect_pub, use listen=True in run_job

This commit is contained in:
Erik Johnson 2017-12-13 03:03:48 -06:00
parent 2ac70cfab5
commit ef749abfc6
No known key found for this signature in database
GPG key ID: 5E5583C437808F3F

View file

@ -37,8 +37,7 @@ log = logging.getLogger(__name__)
def _ping(tgt, tgt_type, timeout, gather_job_timeout):
client = salt.client.get_local_client(__opts__['conf_file'])
client.event.connect_pub(timeout=timeout)
pub_data = client.run_job(tgt, 'test.ping', (), tgt_type, '', timeout, '')
pub_data = client.run_job(tgt, 'test.ping', (), tgt_type, '', timeout, '', listen=True)
if not pub_data:
return pub_data