From 9e804add7a6cc7b10ef9329f98d8449fa93f05ad Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 15 Jan 2013 17:50:09 +0000 Subject: [PATCH] Simplify logic of getting the temporary directory. --- tests/integration/__init__.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py index 04a99699f5..cdbc58dc2b 100644 --- a/tests/integration/__init__.py +++ b/tests/integration/__init__.py @@ -46,11 +46,8 @@ SCRIPT_DIR = os.path.join(CODE_DIR, 'scripts') PYEXEC = 'python{0}.{1}'.format(sys.version_info[0], sys.version_info[1]) -if os.environ.has_key('TMPDIR'): - # Gentoo Portage prefers ebuild tests are rooted in ${TMPDIR} - SYS_TMP_DIR = os.environ['TMPDIR'] -else: - SYS_TMP_DIR = tempfile.gettempdir() +# Gentoo Portage prefers ebuild tests are rooted in ${TMPDIR} +SYS_TMP_DIR = os.environ.get('TMPDIR', tempfile.gettempdir()) TMP = os.path.join(SYS_TMP_DIR, 'salt-tests-tmpdir') FILES = os.path.join(INTEGRATION_TEST_DIR, 'files')