summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sherwood <paul.sherwood@codethink.co.uk>2016-06-23 18:31:11 +0100
committerPaul Sherwood <paul.sherwood@codethink.co.uk>2016-06-23 18:31:44 +0100
commit68bba6f4e63ccb736641a98775f51f000348c677 (patch)
tree8a2799df38a432869328dc42fe41e62dadb01f4f
parent7bf0892f8933d769a560474372b7f7ba7e31fc36 (diff)
downloadybd-68bba6f4e63ccb736641a98775f51f000348c677.tar.gz
Exit if a definition lookup fails
-rw-r--r--ybd/pots.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ybd/pots.py b/ybd/pots.py
index 5658203..2d3dcbf 100644
--- a/ybd/pots.py
+++ b/ybd/pots.py
@@ -38,7 +38,6 @@ class Pots(object):
self._trees = {}
self._set_trees()
self.defaults = Defaults()
- self._save_pots('./definitions.yml')
def get(self, dn):
''' Return a definition from the dictionary.
@@ -48,7 +47,9 @@ class Pots(object):
value in the given dict. '''
if type(dn) is str:
- return self._data.get(dn)
+ if self._data.get(dn):
+ return self._data.get(dn)
+ log(dn, 'Unable to find definition for', dn, exit=True)
return self._data.get(dn.get('path', dn.keys()[0]))