Browse Source

Except block now covers specific errors

Previously too broad exception has been refactored,
in order to stop truly unexpected issues from hiding.

Only ParsingError and OSError is now caught by the block.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I685b6b325fc2c252cb7e656f369a60f958fa72bf
changes/92/786392/1
Jiri Podivin 5 months ago
parent
commit
2470d54bbd
  1. 2
      validations_common/library/validations_read_ini.py

2
validations_common/library/validations_read_ini.py

@ -60,7 +60,7 @@ def get_result(path, section, key, default=None):
try:
config.read(path)
except Exception:
except (OSError, ConfigParser.ParsingError):
msg = "The file '{}' is not in a valid INI format.".format(path)
ret = ReturnValue.INVALID_FORMAT
return (ret, msg, value)

Loading…
Cancel
Save