The .get is a bit confusing because apparently has the same behaviour as dict.get(),
which returns None when the key doesn't exist. But that's not the case, because Config.get in this case is
doing dict["key"], which returns a KeyError when the key does not exist
Change-Id: Ief82eb1ae2e2fea60b8be60cae8610bf8605fb6f
Signed-off-by: David Garcia <david.garcia@canonical.com>
def get(self, section, field=None):
if not field:
return self.conf[section]
- return self.conf[section][field]
+ return self.conf[section].get(field)
def set(self, section, field, value):
if section not in self.conf: