make use of env provided by manifest

Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
Nico Schottelius 2012-11-06 22:39:25 +01:00
parent 6482863c5d
commit 9cf80f5fdf
1 changed files with 6 additions and 8 deletions

View File

@ -39,6 +39,7 @@ my_dir = op.abspath(op.dirname(__file__))
fixtures = op.join(my_dir, 'fixtures')
conf_dir = op.join(fixtures, 'conf')
import logging
class EmulatorTestCase(test.CdistTestCase):
def setUp(self):
@ -48,20 +49,17 @@ class EmulatorTestCase(test.CdistTestCase):
handle, self.script = self.mkstemp(dir=self.temp_dir)
os.close(handle)
out_path = self.temp_dir
self.local = local.Local(
target_host=self.target_host,
out_path=out_path,
exec_path=test.cdist_exec_path,
add_conf_dirs=[conf_dir])
logging.root.setLevel(logging.DEBUG)
self.local.create_files_dirs()
self.env = {
'PATH': "%s:%s" % (self.local.bin_path, os.environ['PATH']),
'__target_host': self.target_host,
'__global': self.local.out_path,
'__cdist_type_base_path': self.local.type_path, # for use in type emulator
'__manifest': self.local.manifest_path,
'__cdist_manifest': self.script,
}
self.manifest = core.Manifest(self.target_host, self.local)
self.env = self.manifest.env_initial_manifest(self.script)
def tearDown(self):
os.environ = self.orig_environ