diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-06-18 22:40:01 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-06-18 22:40:01 +0100 |
| commit | 960ce7582d6624c3858593a7511166302f8c923e (patch) | |
| tree | 3dd5742aa76b65e27b73eb0cd0e40dbfb5e75e0e | |
| parent | 9fe74492045fc7f3ef15c1c7093261fc283a1371 (diff) | |
Correctly throw an error if a required setting is missing.
| -rwxr-xr-x | cdist | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) |
