summaryrefslogtreecommitdiff
path: root/taler/util/talerconfig.py
diff options
context:
space:
mode:
Diffstat (limited to 'taler/util/talerconfig.py')
-rw-r--r--taler/util/talerconfig.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/taler/util/talerconfig.py b/taler/util/talerconfig.py
index 8427f33..79b722e 100644
--- a/taler/util/talerconfig.py
+++ b/taler/util/talerconfig.py
@@ -1,4 +1,3 @@
-# This file is part of TALER
# (C) 2016, 2019 Taler Systems SA
#
# This library is free software; you can redistribute it and/or
@@ -111,7 +110,6 @@ def expand(var: str, getter: Callable[[str], str]) -> str:
return result + var[pos:]
-
##
# A configuration entry.
class Entry:
@@ -170,10 +168,10 @@ class Entry:
# @return the value, or the given @a default, if not found.
def value_string(self, default=None, required=False, warn=False) -> str:
if required and self.value is None:
- raise ConfigurationError(
- "Missing required option '%s' in section '%s'"
- % (self.option.upper(), self.section.upper())
- )
+ print("Missing required option '%s' in section '%s'"
+ % (self.option.upper(), self.section.upper()))
+ sys.exit(1)
+
if self.value is None:
if warn:
if default is not None:
@@ -203,16 +201,17 @@ class Entry:
# @param warn currently ignored.
# @return the value, or the given @a default, if not found.
def value_int(self, default=None, required=False, warn=False) -> int:
- value = self.value_string(default, warn, required)
+ value = self.value_string(default, required, warn)
if value is None:
return None
try:
return int(value)
except ValueError:
- raise ConfigurationError(
+ print(
"Expected number for option '%s' in section '%s'"
% (self.option.upper(), self.section.upper())
)
+ sys.exit(1)
##
# Fetch value to substitute to expansion variables.