diff --git a/docs/opts.rst b/docs/opts.rst index 4436980..bcd0572 100644 --- a/docs/opts.rst +++ b/docs/opts.rst @@ -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 diff --git a/salt_sproxy/_runners/proxy.py b/salt_sproxy/_runners/proxy.py index 49a7bba..e0ca483 100644 --- a/salt_sproxy/_runners/proxy.py +++ b/salt_sproxy/_runners/proxy.py @@ -694,6 +694,7 @@ def execute( args=(), batch_size=10, sync=False, + jid=None, events=True, cache_grains=False, cache_pillar=False, @@ -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. @@ -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, diff --git a/salt_sproxy/parsers.py b/salt_sproxy/parsers.py index 8947ecd..48844d8 100644 --- a/salt_sproxy/parsers.py +++ b/salt_sproxy/parsers.py @@ -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,