The state was not written to support patching a directory, though the
file.patch remote execution function does support patching a directory.
This was likely just due to a careless copypasta from the remote
execution function's docstring to the state function's.
parallel: True codepath incompatibilities uncovered by the added tests.
additionally use salt.serializers.msgpack to avoid other py2/py3/back compat
issues.
@ninja- noticed there was some useful code already in _call_parallel_target to
mitigate KeyErrors for potentially empty cdata, but it wasnt being executed due
to the invoking method making the same mistake before calling it. this moves
that code up to eliminate that potential stacktrace.
this should close#39832
previously durations were only recording the time to spawn the multiprocessing
proc, not the actual time of completion, which is completely wrong. This should
capture the full duration correctly now. We unfortunately have to duplicate
start & complete times instead of using the passed in start_time attr, as that
value is only a time (not date), so it is impossible to re-calculate the full
duration based on that alone (ie, what happens if start_time is 23:59 with
a roll-over to the next day).
This fixes#44828
rather than join()'ing on each running process, we instead use check_running to
assert completion of our processes. This should provide more correct timing results,
as measuring durations of a longer running join()'d process could trample
a shorter parallel process that just happened to be checked after instead of
before.
originally the parallel global state requisite did not work correctly when
invoked under an orch - this fixes that; as well as running any other saltmod
state (function, runner, wheel).
otherwise we get a message like '12:34:00:56:78:90 is not present on this system.'
as dladm prints the '00' as '0' and we fail to correctly identify
the existing interface.
Fix a linting issue while here
SmartOS (no longer?) handles setting an MTU for etherstub devices,
so silently drop it in order to maintain the current API.
salt:2066 salt % doas salt-ssh smartos-gz nictagadm.add storage0 etherstub
smartos-gz:
----------
Error:
Error: Cannot specify MTU for local nic tag
Also fixup two examples while here which failed to run and use
format() in a consistent manner.
Tested on SmartOS 20160204T080230Z and 20180203T031130Z
This tidies the actual command string building and
makes the code more readable in general. The required
binaries are not likely to disappear after __virtual__
has been evaluated.
Use correct nomenclature when referring to 'compute nodes'.