From bc85237eaab020ee71e44b31822693b5312e0871 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 14 Oct 2011 23:04:19 +0200 Subject: [PATCH] make code setup debug env Signed-off-by: Nico Schottelius --- doc/man/cdist-reference.text.sh | 2 +- lib/cdist/core/code.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/man/cdist-reference.text.sh b/doc/man/cdist-reference.text.sh index 7196c3b3..57dbde4a 100755 --- a/doc/man/cdist-reference.text.sh +++ b/doc/man/cdist-reference.text.sh @@ -170,7 +170,7 @@ __debug:: If this variable is setup, cdist runs in debug mode. You can use this information, to only output stuff in debug mode as well. - Available for: initial manifest, type manifest + Available for: initial manifest, type manifest, gencode, code __explorer:: Directory that contains all global explorers. Available for: explorer diff --git a/lib/cdist/core/code.py b/lib/cdist/core/code.py index e81f7954..0f2591b3 100644 --- a/lib/cdist/core/code.py +++ b/lib/cdist/core/code.py @@ -92,6 +92,9 @@ class Code(object): '__global': self.local.out_path, } + if log.getEffectiveLevel() == logging.DEBUG: + self.env.update({'__debug': "yes" }) + def _run_gencode(self, cdist_object, which): cdist_type = cdist_object.type script = os.path.join(self.local.type_path, getattr(cdist_type, 'gencode_%s_path' % which))