in theory catch error when requiring an undefined object (in practise not)
Error message trying to fix: ERROR: [Errno 2] No such file or directory: '/home/users/nico/.tmp/tmptvy1ic/out/object/__localch_yum_repos/singleton/.cdist/state' Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
parent
45c9f629ae
commit
b3337a18b9
1 changed files with 8 additions and 1 deletions
|
@ -106,7 +106,7 @@ class ConfigInstall(object):
|
||||||
"""Run gencode and code for an object"""
|
"""Run gencode and code for an object"""
|
||||||
self.log.debug("Trying to run object " + cdist_object.name)
|
self.log.debug("Trying to run object " + cdist_object.name)
|
||||||
if cdist_object.state == core.Object.STATE_RUNNING:
|
if cdist_object.state == core.Object.STATE_RUNNING:
|
||||||
# FIXME: resolve dependency circle
|
# FIXME: resolve dependency circle / show problem source
|
||||||
raise cdist.Error("Detected circular dependency in " + cdist_object.name)
|
raise cdist.Error("Detected circular dependency in " + cdist_object.name)
|
||||||
elif cdist_object.state == core.Object.STATE_DONE:
|
elif cdist_object.state == core.Object.STATE_DONE:
|
||||||
self.log.debug("Ignoring run of already finished object %s", cdist_object)
|
self.log.debug("Ignoring run of already finished object %s", cdist_object)
|
||||||
|
@ -119,6 +119,13 @@ class ConfigInstall(object):
|
||||||
for requirement in cdist_object.requirements:
|
for requirement in cdist_object.requirements:
|
||||||
self.log.debug("Object %s requires %s", cdist_object, requirement)
|
self.log.debug("Object %s requires %s", cdist_object, requirement)
|
||||||
required_object = cdist_object.object_from_name(requirement)
|
required_object = cdist_object.object_from_name(requirement)
|
||||||
|
|
||||||
|
# The user may have created dependencies without satisfying them
|
||||||
|
if not required_object.exists():
|
||||||
|
raise cdist.Error(cdist_object.name + " requires non-existing " + requirement.name)
|
||||||
|
else
|
||||||
|
self.log.debug("Required object %s exists", requirement.name)
|
||||||
|
|
||||||
self.object_run(required_object)
|
self.object_run(required_object)
|
||||||
|
|
||||||
# Generate
|
# Generate
|
||||||
|
|
Loading…
Reference in a new issue