Many classes of the testing module, such as the HostInformation and Executor classes, rely on the inventory.yaml file to get information. This implementation makes the code complex. Accessing an in-memory structure will simplify the code and improve performance and reliability.
I suggest:
Implement an Inventory class that holds the information in the inventory.yaml.
Validate the existence of the inventory.yaml and create the Inventory instance.
All the functions that currently access the inventory file should be changed to access the Inventory instance.
Description
Many classes of the testing module, such as the HostInformation and Executor classes, rely on the
inventory.yaml
file to get information. This implementation makes the code complex. Accessing an in-memory structure will simplify the code and improve performance and reliability.I suggest:
inventory.yaml
.inventory.yaml
and create the Inventory instance.Related PR comment: comment