From 6c7e280eac188051fb0a6bca0fb33a6d91f492b6 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Thu, 13 Oct 2011 15:11:50 +0200 Subject: [PATCH] remove obsolete method, merge code Signed-off-by: Steven Armstrong --- lib/cdist/core/code.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/cdist/core/code.py b/lib/cdist/core/code.py index b2cc033c..6dfa2da4 100644 --- a/lib/cdist/core/code.py +++ b/lib/cdist/core/code.py @@ -92,20 +92,17 @@ class Code(object): '__global': self.local.out_path, } - def _get_env_for_object(self, cdist_object): - return { - '__type': cdist_object.type.absolute_path, - '__object': cdist_object.absolute_path, - '__object_id': cdist_object.object_id, - '__object_fq': cdist_object.path, - } - 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)) env = os.environ.copy() env.update(self.env) - env.update(self._get_env_for_object(cdist_object)) + env.update({ + '__type': cdist_object.type.absolute_path, + '__object': cdist_object.absolute_path, + '__object_id': cdist_object.object_id, + '__object_fq': cdist_object.path, + }) return self.local.run_script(script, env=env) def run_gencode_local(self, cdist_object):