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
30 stars 37 forks source link

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

Open mustafakemalgilor opened 5 days ago

mustafakemalgilor commented 5 days 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