As part of resolving a resource, record its MD5 hash in the output
metadata. In order to enable this, resource resolution is now done via
the context, rather than directly via the ResourceResolver (in order not
to introduce a context dependency in the Gui object, context now
emulates the resolver interface).
Metadata is a key-value mapping for arbitrary data, similar to
classifiers. Unlike classifiers, metadata does not directly relate to
the results of the execution, but to the execution itself, and typically
would not be processed by Output Processors in the same way as
classifiers. Metadata can also be a lot more free-form in it's value
structure; while classifier values are simple scalars, metadata values
can be arbitrary POD structures.
If the device is to perform an initial reboot, allow up to `max_retries`
from the run configuration for the reboot to succeed and add logging to
inform the user.
Treat the optional reboot of the device as part of the job itself so that
if the reboot fails it will be retried in accordance to the job
configuration.
Instead of starting and stopping the target from inside the Context,
move the calls to the Runner. This allows for the any initilizaton
errors to be dealt with as part of the job and retried as
appropriate.
- expose pluginloader's resolve_alias in plugin_cache (it's supposed
to be a transparent proxy for pluginloader).
- resolve aliases inside _set_plugin_defaults() to make sure the
correct defaults are used when creating job specs.
Expose the RebootPolicy as an attribute of the ExectionContext and ensure
that that the target is not automatically rebooted if the reboot
policy is set to "Never".
Rename the parameter to be clearer on the effect of the policy, as this
will cause WA to reset the device for each new job it runs regardless of
the iteration number.
We only need to deploy the gui once, therefore move the `deploy` method
call into `initialize` the corresponding `remove` method is already in
`finalize`.
- Have the job manage the indent of each of its stages
- Switch output_processor to using indentcontext
- Move the "Configuring augmentations" log line into Job -- the
rest of the stages are logged there, but this was done by the
Executor for some reason.
Add hostid entry, as reported by busybox's hostid applet, to TargetInfo.
This is intended to be a "unique 32-bit identifier for the current
machine". In practice, it may not be set, or may be generated from
something like an IP address, so may not be unique. However, if set, it
is still likely to be more unique than kernel/os version so may be worth
recording.
Replace Target.cpuinfo, which contained parsed contents of
/proc/cpuinfo, with a list of more comprehensive CpuInfo objects which
include cpufreq and cpuidle information as well.
- Use indentcontext inside initialize_run to make sure log level
is dedented on error.
- Ensure Executor postamble always runs, event if runner errors.
- Fix format_duration() to handle sub-second timedeltas.
Add a function to return WA version suffixed with the commit hash for
current HEAD. This only works if WA was deployed via
python setup.py develop
otherwise, the output is identical to get_wa_version().
When scanning modules for plugins, only consider classes defined in that
module, but not those imported into it. This will prevent log output
being polluted with repeated "Skipping..." messages for imported plugin
bases.