ukify: fail if the config file was not read
Inspired by https://github.com/systemd/systemd/pull/28997. Noticed by Alvin Alvarado <alvin@striczkof.io>.
This commit is contained in:
+4
-1
@@ -1413,7 +1413,10 @@ def apply_config(namespace, filename=None):
|
||||
# Do not make keys lowercase
|
||||
cp.optionxform = lambda option: option
|
||||
|
||||
cp.read(filename)
|
||||
# The API is not great.
|
||||
read = cp.read(filename)
|
||||
if not read:
|
||||
raise IOError(f'Failed to read {filename}')
|
||||
|
||||
for section_name, section in cp.items():
|
||||
idx = section_name.find(':')
|
||||
|
||||
Reference in New Issue
Block a user