Mercurial > hg > gcmultimerge
changeset 7:f2ecfb3e04ee
Check that the required section exists in configuration.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 04 Jul 2016 12:54:22 +0300 |
parents | ee6bf617f839 |
children | 8367463fe94d |
files | multimerge.py |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/multimerge.py Mon Jul 04 12:53:11 2016 +0300 +++ b/multimerge.py Mon Jul 04 12:54:22 2016 +0300 @@ -250,6 +250,11 @@ except Exception as e: gcm_fatal("Failed to read configuration file '{0}': {1}".format(sys.argv[1], str(e))) + # Check that the required section exists + section = "gcm" + if not cfgparser.has_section(section): + gcm_fatal("Invalid configuration, missing '{0}' section.".format(section)) + # Parse the settings and validate cfg.mread(cfgparser, section)