Instead of special-casing syncronous commands, add a decorator similar
to @async_command(), which can be used to decorate extension methods
for execution as a synchronous command.
Change-Id: I1b27f179f667cb065bcffd71ae0f303b05d33b82
Move extensions under an ironic_python_agent.extensions module. This
change also moves the @async_command() decorator into the base
extension module.
Change-Id: I4021fcc33a30f3460a31bca44a4bf776cd53d488
Allow configuration via command line arguments or kernel parameters.
Default to agent_ipmitool, the reference driver.
Depends on https://review.openstack.org/#/c/84795/12
Change-Id: I55c4a8713308d038002a6567471cd862bf89ec76
It makes possible of running data-driven flow which's the list of
the other existent extensions to be called.
Change-Id: Ib73ea4da92f291c872b7ae51e46ecc7fdd45ee16
Adding new methods to utils won't work as the circular import appears
between errors.py and utils.py.
Introduce ExecuteCommandMixin and use it for IronicPythonAgent and
FlowExtension (in future patch).
Also add tests for its.
Change-Id: Id95b31349292a7967d2ee66ec82c1662d8e5de94
Bumping the payload version to two, and adding CPU, Memory, and Block
Device information to the inventory.
Added dependency on psutil for available memory and cpu_count.
Requirements line copied from global requirements
Change-Id: Ia39c85c91b1d60468667787a7978020084dc6c2a
This removes the custom function that was in place before our move to
Openstack in favor of the utils method integrated with oslo.
Change-Id: If668e53ccc97743b00c4beae39d153ee63ed015a
The file handle for addr_info was left open, meaning we were leaking
file handles when sending system information. This ensures the handle is
closed.
Change-Id: I4b117d4f9ec32ad3f16f43632ffe9dc96da5ab7f
blockdev --report was being run with the previous way this test was
mocked. This fix causes it to not be run.
Change-Id: I7ab5dcca0a3a89ef4c62a2f40981958de73cd6f1
This payload may change over time and should be versioned.
Corresponds to https://review.openstack.org/#/c/85228/
Change-Id: I58b1d69a2c41ff105038178632e289cb4b12c971
1) Added a py33 environment to tox
2) Updated tests to mock the correctly named builtins.open based on
python version
3) Other minor compatibility fixes
Tests for Python 3.3 will not pass due to this bug:
https://github.com/eventlet/eventlet/issues/83 among possibly others in
eventlet.
Change-Id: Ie4b512a926fa690ee77a71a89851c871ea1f6be0
Using DynamicLoopingCall involved a few hacks to make it work properly. This
new BackOffLoopingCall will start an exponential backoff (with a configurable
jitter) when there is a failure. The backoff will continue until the given
function returns True or timeout is about to be exceeded. The function will
run indefinitely until either an exception is raised or timeout is reached.
I plan to merge this into oslo loopingcall and switch the heartbeat to this.
Change-Id: I1482348e98c6b68c34b3003645029e08135b1341
This patch moves _split_command from IronicPythoAgent class to
utils module. Also fixes import looping.
Change-Id: Ibf2b0b3885286b9ad78db64cf9e195de4ad627ad
It is needed to run OS commands. It uses
oslo processutils. It is just a copy of the
same method in openstack/ironic except
using rootwrap was removed.
Change-Id: I2efede22b1fa25febe91879c0fefcdfc7f3d1dd5
oslotest includes things like showing log messages/stdout on test errors,
which makes debugging much easier. Also moved mock to second group in imports,
as it's a 3rd party library.
Change-Id: I016ae0a376d42dec28085687ea7194df4cd44eda
Added some oslo modules which are needed
for generating config samples and for running
os commands. Re-synced oslo from
b7ad6ddab8b1d61bf4f52ccaa461a9d68809747b which
is master.
Change-Id: I6e35ba1f0df007876f4dc25e7e2bd553986bfa8d
Allow the agent to read arguments from the kernel command line.
Priority is: agent command line, kernel command line, defaults.
Change-Id: Idfd43a8b7fdf6c368cf55d45b32cb7bcfbb56212
Currently, if a single lookup call to the Ironic API fails, the entire
agent errors out and restarts. This allows the agent to retry for a set
amount of time before throwing an uncaught exception forcing a restart.
Change-Id: I39752fb3f42ad3e4f15a49194f1554e1d3463cf8
Closes-Bug: 1297019
Also fixes tests that were broken on PyPy.
Co-Authored-By: Jim Rollenhagen <jim@jimrollenhagen.com>
Change-Id: I2554aa844b040c4c74cbf287dccb06d816a39dbe
Allow multiple extensions to be loaded by switching to ExtensionManager
from stevedore. Remove any reference to modes.
Change-Id: Ic160478625226b4dd17bd68b3d37f3b05823e519