mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Test fixup
This commit is contained in:
parent
6ba1b273ba
commit
ade2eaa057
3 changed files with 12 additions and 9 deletions
|
@ -893,7 +893,7 @@ class EventMonitor(salt.utils.process.SignalHandlingProcess):
|
|||
"""
|
||||
tag, data = salt.utils.event.SaltEvent.unpack(package)
|
||||
if tag.startswith("salt/job") and tag.endswith("/publish"):
|
||||
data.pop("_stamp", None)
|
||||
# data.pop("_stamp", None)
|
||||
log.trace("Forward job event to publisher server: %r", data)
|
||||
# if not self.channels:
|
||||
# for transport, opts in iter_transport_opts(self.opts):
|
||||
|
@ -2381,7 +2381,11 @@ class ClearFuncs(TransportMethods):
|
|||
payload["auth_list"] = auth_list
|
||||
|
||||
# Send it!
|
||||
self.event.fire_event(payload, tagify([jid, "publish"], "job"))
|
||||
# Copy the payload when firing event for now since it's adding a
|
||||
# __pub_stamp field.
|
||||
self.event.fire_event(payload.copy(), tagify([jid, "publish"], "job"))
|
||||
# An alternative to copy may be to pop it
|
||||
# payload.pop("_stamp")
|
||||
self._send_ssh_pub(payload, ssh_minions=ssh_minions)
|
||||
await self._send_pub(payload)
|
||||
|
||||
|
|
|
@ -172,8 +172,8 @@ def test_verify_signature_bad_sig(tmp_path):
|
|||
assert not salt.crypt.verify_signature(str(tmp_path.joinpath("bar.pub")), msg, sig)
|
||||
|
||||
|
||||
def test_read_or_generate_key_string(tempdir):
|
||||
keyfile = tempdir.tempdir / ".aes"
|
||||
def test_read_or_generate_key_string(tmp_path):
|
||||
keyfile = tmp_path / ".aes"
|
||||
assert not keyfile.exists()
|
||||
first_key = salt.crypt.Crypticle.read_or_generate_key(keyfile)
|
||||
assert keyfile.exists()
|
||||
|
@ -183,9 +183,7 @@ def test_read_or_generate_key_string(tempdir):
|
|||
assert second_key != third_key
|
||||
|
||||
|
||||
def test_dropfile_contents(tempdir, master_opts):
|
||||
salt.crypt.dropfile(
|
||||
str(tempdir.tempdir), master_opts["user"], master_id=master_opts["id"]
|
||||
)
|
||||
with salt.utils.files.fopen(str(tempdir.tempdir / ".dfn"), "r") as fp:
|
||||
def test_dropfile_contents(tmp_path, master_opts):
|
||||
salt.crypt.dropfile(str(tmp_path), master_opts["user"], master_id=master_opts["id"])
|
||||
with salt.utils.files.fopen(str(tmp_path / ".dfn"), "r") as fp:
|
||||
assert master_opts["id"] == fp.read()
|
||||
|
|
|
@ -318,6 +318,7 @@ def test_clear_funcs_black(master_opts):
|
|||
"_prep_auth_info",
|
||||
"_prep_jid",
|
||||
"_prep_pub",
|
||||
"_send_pub",
|
||||
"_send_ssh_pub",
|
||||
"connect",
|
||||
"destroy",
|
||||
|
|
Loading…
Add table
Reference in a new issue