From 91ecfa7d3f185e4baab2d5a3e903924d4170c026 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 12 Feb 2012 01:27:25 +0100 Subject: [PATCH] back to 100% tests working Signed-off-by: Nico Schottelius --- lib/cdist/emulator.py | 8 +++++--- lib/cdist/exec/local.py | 2 +- lib/cdist/test/code/__init__.py | 4 ++-- lib/cdist/test/explorer/__init__.py | 6 ++---- lib/cdist/test/object/__init__.py | 2 ++ 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/cdist/emulator.py b/lib/cdist/emulator.py index 77bc5ac8..72ed3b9b 100644 --- a/lib/cdist/emulator.py +++ b/lib/cdist/emulator.py @@ -41,14 +41,16 @@ class Emulator(object): self.object_id = False self.global_path = os.environ['__global'] - self.object_source = os.environ['__cdist_manifest'] self.target_host = os.environ['__target_host'] + + # Internally only + self.object_source = os.environ['__cdist_manifest'] self.type_base_path = os.environ['__cdist_type_base_path'] self.object_base_path = os.path.join(self.global_path, "object") self.type_name = os.path.basename(argv[0]) - self.cdist_type = core.Type(self.type_base_path, self.type_name) + self.cdist_type = core.CdistType(self.type_base_path, self.type_name) self.__init_log() @@ -156,7 +158,7 @@ class Emulator(object): requirement_type_name, requirement_object_id = core.CdistObject.split_name(requirement) # Instantiate type which fails if type does not exist - requirement_type = core.Type(self.type_base_path, requirement_type_name) + requirement_type = core.CdistType(self.type_base_path, requirement_type_name) if requirement_object_id: # Validate object_id if any diff --git a/lib/cdist/exec/local.py b/lib/cdist/exec/local.py index 613f5cf2..cdf06205 100644 --- a/lib/cdist/exec/local.py +++ b/lib/cdist/exec/local.py @@ -143,7 +143,7 @@ class Local(object): def link_emulator(self, exec_path): """Link emulator to types""" src = os.path.abspath(exec_path) - for cdist_type in core.Type.list_types(self.type_path): + for cdist_type in core.CdistType.list_types(self.type_path): dst = os.path.join(self.bin_path, cdist_type.name) self.log.debug("Linking emulator: %s to %s", src, dst) diff --git a/lib/cdist/test/code/__init__.py b/lib/cdist/test/code/__init__.py index 176f139c..dc701cce 100644 --- a/lib/cdist/test/code/__init__.py +++ b/lib/cdist/test/code/__init__.py @@ -48,8 +48,8 @@ class CodeTestCase(test.CdistTestCase): self.remote_base_path = self.mkdtemp() self.user = getpass.getuser() - remote_exec = "ssh -o User=%s -q" % "root" # self.user - remote_copy = "scp -o User=%s -q" % "root" # self.user + remote_exec = "ssh -o User=%s -q" % self.user + remote_copy = "scp -o User=%s -q" % self.user self.remote = remote.Remote(self.target_host, self.remote_base_path, remote_exec, remote_copy) self.code = code.Code(self.target_host, self.local, self.remote) diff --git a/lib/cdist/test/explorer/__init__.py b/lib/cdist/test/explorer/__init__.py index 716e56b7..257ad8a9 100644 --- a/lib/cdist/test/explorer/__init__.py +++ b/lib/cdist/test/explorer/__init__.py @@ -49,10 +49,8 @@ class ExplorerClassTestCase(test.CdistTestCase): self.remote_base_path = self.mkdtemp() self.user = getpass.getuser() - #remote_exec = "ssh -o User=%s -q" % self.user - #remote_copy = "scp -o User=%s -q" % self.user - remote_exec = "ssh -o User=%s -q" % "root" - remote_copy = "scp -o User=%s -q" % "root" + remote_exec = "ssh -o User=%s -q" % self.user + remote_copy = "scp -o User=%s -q" % self.user self.remote = remote.Remote(self.target_host, self.remote_base_path, remote_exec, remote_copy) self.explorer = explorer.Explorer(self.target_host, self.local, self.remote) diff --git a/lib/cdist/test/object/__init__.py b/lib/cdist/test/object/__init__.py index 00cc1e00..0f8c0189 100644 --- a/lib/cdist/test/object/__init__.py +++ b/lib/cdist/test/object/__init__.py @@ -25,6 +25,8 @@ import shutil from cdist import test from cdist import core +import cdist + import os.path as op my_dir = op.abspath(op.dirname(__file__)) fixtures = op.join(my_dir, 'fixtures')