Wed, Apr 20, 2016 at 02:29:01PM CEST, jprochaz(a)redhat.com wrote:
Hello everyone,
first working draft implementation is completed. Please, read this cover
letter, check the patches and let me know what you like, what you don't like,
etc. Please, note, that this is not final implementation.
NOTE - patches are not rebased to current HEAD, if you want to try it,
please, reset your branch to commit 2398f93.
What doesn't work
=================
multi_match - didn't have time and resources to check physical machines,
on virt setup it works, but ends with exception due to no res value returned
loopbacks - can't be created
netem support - not implemented yet
Description of new mechanics
============================
Since we need to run TaskAPI methods to get machine requirements from PyRecipe,
methods like provision_machines, prepare_network are run after the python recipe
is executed. Methods add_host and add_interface create machine requirements dict
in ControllerAPI object. When lnst.match() is called, it runs match algorithm
with mreq dict and if match is found, it prepares network and binds Machine
and Interface objects with their HostAPI and InterfaceAPI counterparts.
When everyting is prepared, execution returns to PyRecipe, where task phase
of PyRecipe is executed. Task phase is the same like before, only new method
is breakpoint() which will be useful for debugging, as it allows user to pause
the execution in whatever part of test.
TaskAPI is now used right from lnst module, all callable methods are exported
via __init__.py file from lnst/ dir.
Folder pyrecipes/ contains few working examples you can try.
Patches 3 and 4 are quite hard to review since they are all sqaushed-up.
Would it be possible to cut them into multiple patches please?
The example usage looks awesome to me. Nice work!
Thanks!