From 1bb3c82d729a1c0b721f10000e2012218812d467 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 7 Nov 2012 11:47:26 +0100 Subject: [PATCH] cleanup some logging stuff Signed-off-by: Nico Schottelius --- cdist/test/code/__init__.py | 5 +---- cdist/test/explorer/__init__.py | 3 --- cdist/test/manifest/__init__.py | 2 ++ 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/cdist/test/code/__init__.py b/cdist/test/code/__init__.py index f5d445ab..284ef9c0 100644 --- a/cdist/test/code/__init__.py +++ b/cdist/test/code/__init__.py @@ -20,10 +20,9 @@ # # +import getpass import os import shutil -import getpass -import logging import cdist from cdist import core @@ -63,8 +62,6 @@ class CodeTestCase(test.CdistTestCase): self.cdist_object = core.CdistObject(self.cdist_type, self.local.object_path, 'whatever') self.cdist_object.create() - self.log = logging.getLogger("cdist") - def tearDown(self): shutil.rmtree(self.out_path) shutil.rmtree(self.remote_base_path) diff --git a/cdist/test/explorer/__init__.py b/cdist/test/explorer/__init__.py index 266a1073..a97b538a 100644 --- a/cdist/test/explorer/__init__.py +++ b/cdist/test/explorer/__init__.py @@ -23,7 +23,6 @@ import os import shutil import getpass -import logging import cdist from cdist import core @@ -67,8 +66,6 @@ class ExplorerClassTestCase(test.CdistTestCase): self.local, self.remote) - self.log = logging.getLogger(self.target_host) - def tearDown(self): shutil.rmtree(self.temp_dir) diff --git a/cdist/test/manifest/__init__.py b/cdist/test/manifest/__init__.py index 0de04743..727017e7 100644 --- a/cdist/test/manifest/__init__.py +++ b/cdist/test/manifest/__init__.py @@ -107,6 +107,8 @@ class ManifestTestCase(test.CdistTestCase): self.assertEqual(output_dict['__object_name'], cdist_object.name) def test_debug_env_setup(self): + current_level = self.log.getEffectiveLevel() self.log.setLevel(logging.DEBUG) manifest = cdist.core.manifest.Manifest(self.target_host, self.local) self.assertTrue("__cdist_debug" in manifest.env) + self.log.setLevel(current_level)