canonical / hotsos

Software analysis toolkit. Define checks in high-level language and leverage library to perform analysis of common Cloud applications.
Apache License 2.0
33 stars 38 forks source link

cli/get_repo_info: suppress importlib.path deprecation warning #925

Open xmkg opened 4 months ago

xmkg commented 4 months ago

we're aware that the importlib.path is being deprecated but we still want to support python 3.8, which does not have the as_file function.

also noticed that when the resources.path() used in a with clause, it raises an exception when the file is not present in Python 3.8.10, which is the latest python 3.8 version in Focal at the moment. Therefore, used contextlib.suppress(Exception) to deal with that as well.

Relevant past MP's: #864, #854

xmkg commented 3 months ago

@dosaboy rebased this one, should be trivial enough to land.