summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-06-18 22:40:01 +0100
committerCarl Hetherington <cth@carlh.net>2016-06-18 22:40:01 +0100
commit960ce7582d6624c3858593a7511166302f8c923e (patch)
tree3dd5742aa76b65e27b73eb0cd0e40dbfb5e75e0e
parent9fe74492045fc7f3ef15c1c7093261fc283a1371 (diff)
Correctly throw an error if a required setting is missing.
-rwxr-xr-xcdist4
1 files changed, 2 insertions, 2 deletions
diff --git a/cdist b/cdist
index cf42ee7..3aa09a3 100755
--- a/cdist
+++ b/cdist
@@ -121,10 +121,10 @@ class Config:
def get(self, k):
for o in self.options:
if o.key == k:
+ if o.value is None:
+ raise Error('Required setting %s not found' % k)
return o.value
- raise Error('Required setting %s not found' % k)
-
def set(self, k, v):
for o in self.options:
o.offer(k, v)