neoave / mrack

Multicloud use-case based multihost async provisioner for CIs and testing during development
Apache License 2.0
11 stars 14 forks source link

Refactor providers to share same code #31

Closed Tiboris closed 3 years ago

Tiboris commented 4 years ago

Methods provision_hosts, delete_hosts and to_host were moved to provider.py as they can be easily shared among the providers.

Added missing methods to provider.py to share same structure. Not implemented methods will throw a NotImplementedError() and they are ment to be implmented per provider.

Moved host count to initialization of openstack provider to set poll sleeps based on this.

For all providers moved STATUS_MAP to class so from now on it is a class attribute.

Openstack's wait_till_provisioned now uses instance and not only id to match inherited method.

Added optional username parameter to to_host method.

Signed-off-by: Tibor Dudlák tdudlak@redhat.com

pvoborni commented 4 years ago

The following commit contains the idea which I described in the review comments. Only for OpenStack provider. Untested.

https://github.com/pvoborni/mrack/commit/71bef84bf9e543bdca8f35ef5de717408abf1c96