1
0
Fork 0

tuned: fixed exception if there is an option without section in profile

e.g. the following caused an exception:
include=profile

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
Jaroslav Škarvada 2017-03-02 11:41:35 +01:00
parent 1ba523b1f3
commit a77119aff0

View file

@ -86,7 +86,11 @@ class Loader(object):
self._variables.add_from_cfg(config_obj[section], os.path.dirname(file_name))
else:
config[section] = collections.OrderedDict()
for option in config_obj[section].keys():
try:
keys = config_obj[section].keys()
except AttributeError:
raise InvalidProfileException("Error parsing section '%s' in file '%s'." % (section, file_name))
for option in keys:
config[section][option] = config_obj[section][option]
# hack to notify plugins about profile location