better debugging for wrong type, fix emulator tests, fixes #176

Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
Nico Schottelius 2013-05-27 16:36:20 +02:00
commit 3d73cd2fd3
2 changed files with 9 additions and 4 deletions

View file

@ -184,7 +184,12 @@ class Emulator(object):
if len(requirement) == 0: continue
# Raises an error, if object cannot be created
cdist_object = self.cdist_object.object_from_name(requirement)
try:
cdist_object = self.cdist_object.object_from_name(requirement)
except core.cdist_type.NoSuchTypeError:
self.log.error("%s requires object %s with non-existing type at %s" % (self.cdist_object.name, requirement, self.object_source))
raise
self.log.debug("Recording requirement: " + requirement)