Closed edtanous closed 1 year ago
@mraineri Do you know why we conditionally import things? That seems like it would cause us to have a lot of these types of bugs over time. Could we just import everything at the top of each file? That seems like a more common pattern I see for python stuff.
In the spirit of optimization, I believe it saves a marginal amount of memory.
As a design practice I agree it's not necessary at all for a python tool, and is worth grouping it up top for consistency.
Generally I've preferred things all imported at the top. If you see other areas where that's not the case, let's fix them.
Merging now since this is a crash issue.
Because of the conditional imports, when doing the name change from common to redfish_service_validator, one import got missed. This causes a bug where, if the schema pack directory is empty, redfish service validator fails with an ImportError.
This commit fixes the import.
Tested: Deleting the SchemaPack and running the service validator no longer fails.
Signed-off-by: Ed Tanous edtanous@google.com