Convention for naming test files is test_*
Rename the utils.py to test_utils.py to match convention.
Change-Id: Idfbfa00dc47c6a60a0fb82b81b1bca0a8dfa345a
Adding documentation for methods in these files that were missing
docstrings.
Change-Id: I2ad9f85605720ab2295dec3d0436ff0af07847c2
Partial-bug: 1367915
ordereddict, and a related workaround method, were removed as we no
longer support python 2.6. Collections contains ordereddict on newer
python versions.
Change-Id: I48cc55a5c56fbc1f71442fc858eb4905f0213988
The code that is covered in this exception block
does not actually retry three times, so it seems better
to have the message not reference that it does.
Change-Id: I0cc19aab65aa9ba4d73a8842390b712f7f63925c
Instead of silently failing, raise DeviceNotFound when no root device
hints were provided and all found block devices are smaller than 4GB.
Change-Id: Idd2e2c5905adf847f00ad15a84a817c3715225dd
Closes-Bug: #1490761
Moved tests/extensions to tests/unit/extensions, otherwise they
wouldn't have run. Renamed the files in tests/unit/extensions to be
prefixed with 'test_', to match the rest of the test files. Did a
general clean up of tox.ini so we have standard whitespace.
Change-Id: I5615bfbf2d6ff4a4bc3e66e71c2472b0d1e3a2d7
Hardware managers should load at runtime. This will ensure the agent is
ready to respond to API calls before it begins heartbeating. Also, it
means in case of a syntax or other error in a HardwareManager, the agent
will crash before it heartbeats, which is better than it working until a
hardware manager method is needed.
Change-Id: I9403ce7bedc8d5af20b6d84371367253b26b74c2
Closes-bug: 1490008
oslo_log wasn't getting the correct config values passed in, so adding
'--debug' to the command line wouldn't enable debug logging.
Added docs about --debug and --standalone (the only two flags I've
seen used/supported).
Change-Id: Ie1ba64992444a65a40f2d65933942153b93e70c1
There is no way for two hardware managers to handle erasing two disks
in two different ways. dispatch_to_managers was designed specifically
for this case, and the default behavior will remain the same for the
GenericHardwareManager (erase_block_device will pick up each disk).
Also return the result of the dispatch calls, so they'll be logged by
Ironic and give more cleaning insight.
Change-Id: I19e9dc8539a0729fbb96cae92fe633e24608fc68
This function is useful in any HardwareManager that interacts with
disks. Subclassing GenericHardwareManager is not ideal for any
hardware manager that interacts with only specific devices.
Change-Id: Ib20e68a8916590513c0a825e44407a110cfbb441
After successful inspection we will know node UUID already, so no need
to do a proper lookup. In the future we might get rid of lookup completely
in this case.
Change-Id: Ic00049bf69f9ecc59ac4e389a3e6afe20ba67aba
* Added NetworkInterface.ip4_address
* Added HardwareManager.get_bmc_address()
* Added Memory.physical_mb
This is total memory as reported by dmidecode, and yes,
it's different from total, as it includes kernel reserved space.
* Added CPU.architecture
As a side effect, get_cpus was switched to lscpu.
Also fixes problem when get_cpus reported the current frequency
instead of maximum one.
Change-Id: I4080d4d551eb0bb995a94ef9a300351910c09fb9
Starts up an agent in a thread and then runs functional tests against
it.
Add the first functional test of the API: a simple test of the
commands API.
Co-Authored-By: Mario Villaplana <mario.villaplana@gmail.com>
Change-Id: If4ad611929d388a2a9454224646cb296bd0ba0ce
Exception messages weren't being bubbled up to the API because the
base exception class wasn't printing correctly. This adds a string
and representation function to ensure they print properly and show
up correctly when debugging interactively.
Cleaned up the `message` attr on the exception classes. It looks
like they started out all without a period, but started adding them
later. Changed classes that were setting error `details` == `message`
to use the default details provided in RESTError.
Change-Id: I1ce256585c9a574e1d1f857c7dc4c417a56b913b
This is a fixup patch for bde6ed557034bc2eac633ff84f2e9515a5ef14d6,
and should follow the OpenStack Logging Standards.
Change-Id: Ie277c5742ab736f4c5cee1ee1badedf055323515
The param was added to the GenericHardwareManager but it wasn't added
to the base class.
This is a breaking API change for the hardware managers.
Change-Id: Ia73fe14308986496e3a4f8d71bc2298a9130cffa
Debugging the agent is a huge pain point. Tracebacks are rarely logged,
error messages are often only returned via the API, and lack of
info logging makes it hard to determine where some failures occur.
Some errors only return a 500 with no error message or logs.
Change-Id: I0a127de6e4abf62e20d5c5ad583ba46738604d2d
This patch add Python 3 support for IPA. We still need to enable it on
gate to avoid code breaking the support from sneaking in.
Partial-Bug: #1474896
Depends-On: I5a774eaa8d978f4d50faca4dc1b03a87fb194ce2
Change-Id: If47c0797b63d2914b3c47aba62ec5201301b6c33
Was running into 'expected string, int found' when calling
shred with an Int for iterations.
Change-Id: Iffce247caba5b0d62ac89b6411402c8d975cfd2f
Closes-Bug: #1469838
When writing to a host device, possibly one that does not support holes,
it is preferable to use host_device instead of the raw mode. Not doing so
means holes are simply skipped and the deployed image is invalid.
Change-Id: I24f8b4daf099af8bb03c3a4f6417b6c87bd49021
Closes-Bug: #1466632
Today, there is no option to configure number of iterations to be
done for shred block device erasing and defaults it to 1. This patch
adds a configuration option to change the number of passes to be done
to erase a block device.
Change-Id: I1921d33a6b364c4682b6c9baaf61ac092cfa11d7
Partial-Bug:#1465130
This commit adds a new command power_off to
standby extension which runs shutdown -h now
on the system. This commit also adds mappings
for /proc and /sys in cloud-config.yml for the
agent service spawned.
Partial-Bug: #1451310
Change-Id: I2a5f984af26bbbe03002bb8c367c8c6af8d91434
This does a few things:
* Update hacking to the version in global-requirements. Old hacking was
installing a version of pbr that was breaking other packages.
* Fix all the hacking/pep8 rules that updating hacking raised.
* Do some general docstring cleanup, while already in there cleaning up
a bunch of docstrings due to H405 violations.
Change-Id: I1fc1e59d4c3d7b14631f8b576e3f3854bc452188
Closes-Bug: #1461717
This commit echoes '1' to >/proc/sys/kernel/sysrq to
make sure that sysrq functions are enabled before
invoking them.
Change-Id: I88697efbc1bd0dec5ed4cbcd8d89b0b5d0734bdd
in-band disk erase using shred fails with error "'module' object has no
attribute 'ProcessExecutionError'". This commit is to fix the issue.
Change-Id: Ia0c426074b2f0e9d534ed96a3e213933160edc61
Closes-Bug:#144799
In-band disk erase using shred fails for agent_ilo driver as it tries to
erase the virtual floppy device attached.This fix is to skip the virtual
media devices and continue with other disks.
Change-Id: I26745985382d440f7d4b3fbfffb14545067fcca6
Closes-Bug:#1450298
When using virtual media, restarting ironic-python-agent
leads to errors like 'File exists'. This is because
we use static directory (/vmedia_mnt) as mount path
and we don't remove it. It's better to use mkdtemp to create
a temporary directory for mounting virtual media
device.
Change-Id: Ibb4c3d3a2024cf51ef198bd396fb9e86ad72a320
The docstrings here were all giving WARNINGs or ERRORs during the docs
build, and were generally making unappealing looking developer
documentation. I corrected the syntax and did what was neccessary to
make the build come out clean.
Change-Id: I74b00a7f125770b0468cff3bdf26d0d52cd054d7
(cherry picked from commit c0921cdff372ce1fd6df1c4ab4eb5463e2cba0e4)
This adds and configures a sphinx doc builder. This is based on the code
in Ironic to build documentation.
The goal is for this to contain development documentation relevant to
hacking on the agent, including how to make custom HardwareManagers.
Change-Id: Ib6cecb9959f4ad5c71440fb37827b996582a9545