From 4c29d9839b64f3a4ff7ec3e800b578bfa3ee3111 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 11 Oct 2011 16:19:27 +0200 Subject: [PATCH] configure logger based on hostname Signed-off-by: Nico Schottelius --- bin/cdist | 4 ---- lib/cdist/context.py | 13 ++++++++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/bin/cdist b/bin/cdist index 50e66697..ac863e9e 100755 --- a/bin/cdist +++ b/bin/cdist @@ -114,10 +114,6 @@ def configinstall(args, mode): time_start = time.time() - # FIXME: do not overwrite, if set! - os.environ['__remote_exec'] = "ssh -o User=root -q" - os.environ['__remote_copy'] = "scp -o User=root -q" - for host in args.host: c = mode(host, initial_manifest=args.manifest, diff --git a/lib/cdist/context.py b/lib/cdist/context.py index d8d4e5ea..f1cd4c14 100644 --- a/lib/cdist/context.py +++ b/lib/cdist/context.py @@ -38,7 +38,8 @@ class Context: target_host, initial_manifest=False, base_path=False, - exec_path=sys.argv[0]): + exec_path=sys.argv[0], + debug): self.target_host = target_host @@ -88,6 +89,16 @@ class Context: self.remote_type_path = os.path.join(self.remote_conf_path, "type") self.remote_global_explorer_path = os.path.join(self.remote_conf_path, "explorer") + if '__remote_exec' in os.environ: + self.remote_exec = os.environ['__remote_exec'] + else: + self.remote_exec = "ssh -o User=root -q" + + if '__remote_copy' in os.environ: + self.remote_copy = os.environ['__remote_copy'] + else: + self.remote_copy = "scp -o User=root -q" + def cleanup(self): # Do not use in __del__: # http://docs.python.org/reference/datamodel.html#customization