diff options
-rw-r--r-- | lorrycontroller/readconf.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lorrycontroller/readconf.py b/lorrycontroller/readconf.py index b455583..9ea8173 100644 --- a/lorrycontroller/readconf.py +++ b/lorrycontroller/readconf.py @@ -316,8 +316,16 @@ class LorryControllerConfValidator(object): self._check_has_required_fields( section, ['trovehost', 'protocol', 'interval', 'ls-interval', 'prefixmap']) + self._check_protocol(section) self._check_prefixmap(section) + def _check_protocol(self, section): + valid = ('ssh', 'http', 'https') + if section['protocol'] not in valid: + raise ValidationError( + 'protocol field has value "%s", but valid ones are %s' % + (section['protocol'], ', '.join(valid))) + def _check_prefixmap(self, section): # FIXME: We should be checking the prefixmap for things like # mapping to a prefix that starts with the local Trove ID, but |