From 6dada17509e7dd37543d654a3f5f92402d091283 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Thu, 13 Oct 2011 16:53:07 +0200 Subject: [PATCH] only run type manifest if it exists Signed-off-by: Steven Armstrong --- lib/cdist/core/manifest.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/cdist/core/manifest.py b/lib/cdist/core/manifest.py index c1d6b7f0..93eb6f2d 100644 --- a/lib/cdist/core/manifest.py +++ b/lib/cdist/core/manifest.py @@ -84,13 +84,14 @@ class Manifest(object): def run_type_manifest(self, cdist_object): script = os.path.join(self.local.type_path, cdist_object.type.manifest_path) - env = os.environ.copy() - env.update(self.env) - env.update({ - '__object': cdist_object.absolute_path, - '__object_id': cdist_object.object_id, - '__object_fq': cdist_object.path, - '__type': cdist_object.type.absolute_path, - '__cdist_manifest': script, - }) - return self.local.run_script(script, env=env) + if os.path.isfile(script): + env = os.environ.copy() + env.update(self.env) + env.update({ + '__object': cdist_object.absolute_path, + '__object_id': cdist_object.object_id, + '__object_fq': cdist_object.path, + '__type': cdist_object.type.absolute_path, + '__cdist_manifest': script, + }) + return self.local.run_script(script, env=env)