mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add a test.arg variant that cleans the pub kwargs by default
This commit is contained in:
parent
d385dfd19d
commit
9f4eb80d90
1 changed files with 12 additions and 0 deletions
|
@ -311,6 +311,18 @@ def arg_repr(*args, **kwargs):
|
|||
return {"args": repr(args), "kwargs": repr(kwargs)}
|
||||
|
||||
|
||||
def arg_clean(*args, **kwargs):
|
||||
'''
|
||||
Like test.arg but cleans kwargs of the __pub* items
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' test.arg_clean 1 "two" 3.1 txt="hello" wow='{a: 1, b: "hello"}'
|
||||
'''
|
||||
return dict(args=args, kwargs=salt.utils.clean_kwargs(**kwargs))
|
||||
|
||||
|
||||
def fib(num):
|
||||
'''
|
||||
Return the num-th Fibonacci number, and the time it took to compute in
|
||||
|
|
Loading…
Add table
Reference in a new issue