From a1655856999a06fae352e61bf54d6b29561d58dd Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 27 Sep 2011 16:20:46 +0200 Subject: [PATCH] pass __debug to manifest Signed-off-by: Nico Schottelius --- lib/cdist/config.py | 5 ++++- lib/cdist/emulator.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/cdist/config.py b/lib/cdist/config.py index 05bdb2a1..6df5d6d8 100644 --- a/lib/cdist/config.py +++ b/lib/cdist/config.py @@ -149,10 +149,13 @@ class Config: env['__target_host'] = self.target_host env['__global'] = self.path.out_dir + # Submit debug flag to manifest, can be used by emulator and types + env['__debug'] = "yes" + # Required for recording source env['__cdist_manifest'] = manifest - # Required to find types + # Required to find types env['__cdist_type_base_dir'] = self.path.type_base_dir # Other environment stuff diff --git a/lib/cdist/emulator.py b/lib/cdist/emulator.py index 6a99ba79..9fc7c576 100644 --- a/lib/cdist/emulator.py +++ b/lib/cdist/emulator.py @@ -36,6 +36,9 @@ def run(argv): global_dir = os.environ['__global'] object_source = os.environ['__cdist_manifest'] + if '__debug' in os.environ: + logging.root.setLevel(logging.DEBUG) + parser = argparse.ArgumentParser(add_help=False) # Setup optional parameters @@ -134,7 +137,7 @@ def run(argv): source_fd.writelines(object_source) source_fd.close() - print("Finished " + type + "/" + object_id + repr(params)) + log.debug("Finished " + type + "/" + object_id + repr(params)) def link(exec_path, bin_dir, type_list):