Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --jid CLI option #63

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/opts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ already familiar with a vast majority of them from the `salt
Whether should return the entire output at once, or for every device
separately as they return.

.. option:: --jid

.. versionadded:: 2019.12.0

Pass a custom JID (Job ID) to be used instead of generating one.

.. option:: --cache-grains

Cache the collected Grains. Beware that this option overwrites the existing
Expand Down
5 changes: 5 additions & 0 deletions salt_sproxy/_runners/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ def execute(
args=(),
batch_size=10,
sync=False,
jid=None,
events=True,
cache_grains=False,
cache_pillar=False,
Expand Down Expand Up @@ -766,6 +767,9 @@ def execute(
Whether to return the results synchronously (or return them as soon
as the device replies).

jid: ``None``
The JID to pass on, when executing.

events: ``True``
Whether should push events on the Salt bus, similar to when executing
equivalent through the ``salt`` command.
Expand Down Expand Up @@ -904,6 +908,7 @@ def execute(
args=args,
batch_size=batch_size,
sync=sync,
jid=jid,
events=events,
cache_grains=cache_grains,
cache_pillar=cache_pillar,
Expand Down
5 changes: 5 additions & 0 deletions salt_sproxy/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ def _mixin_setup(self):
dest='roster_file',
help='Absolute path to the Roster file to use.',
)
self.add_option(
'--jid',
default=None,
help='Pass a JID to be used instead of generating one.',
)
self.add_option(
'--sync',
default=False,
Expand Down