MCPcopy
hub / github.com/saltstack/salt / _prep_jid

Method _prep_jid

salt/master.py:4123–4145  ·  view source on GitHub ↗

Return a jid for this publication

(self, clear_load, extra)

Source from the content-addressed store, hash-verified

4121 return auth_type, err_name, key, sensitive_load_keys
4122
4123 def _prep_jid(self, clear_load, extra):
4124 """
4125 Return a jid for this publication
4126 """
4127 # the jid in clear_load can be None, '', or something else. this is an
4128 # attempt to clean up the value before passing to plugins
4129 passed_jid = clear_load["jid"] if clear_load.get("jid") else None
4130 nocache = extra.get("nocache", False)
4131
4132 # Retrieve the jid
4133 fstr = "{}.prep_jid".format(self.opts["master_job_cache"])
4134 try:
4135 # Retrieve the jid
4136 jid = self.mminion.returners[fstr](nocache=nocache, passed_jid=passed_jid)
4137 except (KeyError, TypeError):
4138 # The returner is not present
4139 msg = (
4140 "Failed to allocate a jid. The requested returner '{}' "
4141 "could not be loaded.".format(fstr.split(".")[0])
4142 )
4143 log.error(msg)
4144 return {"error": msg}
4145 return jid
4146
4147 async def _send_pub(self, load):
4148 """

Callers 1

publishMethod · 0.95

Calls 3

formatMethod · 0.80
getMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected