util: replace toml imports with our util module
This commit is contained in:
parent
292d4ad0fe
commit
bce908e4a2
1 changed files with 2 additions and 7 deletions
|
|
@ -188,17 +188,12 @@ def get_host_storage():
|
|||
"""
|
||||
# pylint: disable=import-outside-toplevel
|
||||
# importing this at the top level will break the buildroot
|
||||
try:
|
||||
import tomllib as toml
|
||||
except ImportError:
|
||||
import tomli as toml
|
||||
from osbuild.util import toml
|
||||
|
||||
config_paths = ("/etc/containers/storage.conf", "/usr/share/containers/storage.conf")
|
||||
for conf_path in config_paths:
|
||||
try:
|
||||
with open(conf_path, "rb") as conf_file:
|
||||
storage_conf = toml.load(conf_file)
|
||||
return storage_conf
|
||||
return toml.load_from_file(conf_path)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue