MCPcopy Create free account
hub / github.com/saltstack/salt / exec_

Function exec_

salt/modules/idem.py:25–71  ·  view source on GitHub ↗

Call an idem execution module path The idem path of the idem execution module to run acct_file Path to the acct file used in generating idem ctx parameters. Defaults to the value in the ACCT_FILE environment variable. acct_key Key used to decrypt t

(path, acct_file=None, acct_key=None, acct_profile=None, *args, **kwargs)

Source from the content-addressed store, hash-verified

23
24
25def exec_(path, acct_file=None, acct_key=None, acct_profile=None, *args, **kwargs):
26 """
27 Call an idem execution module
28
29 path
30 The idem path of the idem execution module to run
31
32 acct_file
33 Path to the acct file used in generating idem ctx parameters.
34 Defaults to the value in the ACCT_FILE environment variable.
35
36 acct_key
37 Key used to decrypt the acct file.
38 Defaults to the value in the ACCT_KEY environment variable.
39
40 acct_profile
41 Name of the profile to add to idem's ctx.acct parameter.
42 Defaults to the value in the ACCT_PROFILE environment variable.
43
44 args
45 Any positional arguments to pass to the idem exec function
46
47 kwargs
48 Any keyword arguments to pass to the idem exec function
49
50 CLI Example:
51
52 .. code-block:: bash
53
54 salt '*' idem.exec test.ping
55
56 :maturity: new
57 :depends: acct, pop, pop-config, idem
58 :platform: all
59 """
60 hub = __utils__["idem.hub"]()
61
62 coro = hub.idem.ex.run(
63 path,
64 args,
65 {k: v for k, v in kwargs.items() if not k.startswith("__")},
66 acct_file=acct_file or hub.OPT.acct.acct_file,
67 acct_key=acct_key or hub.OPT.acct.acct_key,
68 acct_profile=acct_profile or hub.OPT.acct.acct_profile or "default",
69 )
70
71 return hub.pop.Loop.run_until_complete(coro)

Callers

nothing calls this directly

Calls 2

runMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected