2021-01-08 13:41:50 +01:00
|
|
|
From 33766e59bd53fac2c75e6ccfa1f363e2f7b1b65f Mon Sep 17 00:00:00 2001
|
2020-04-07 14:14:01 +02:00
|
|
|
From: Jochen Breuer <jbreuer@suse.de>
|
|
|
|
Date: Mon, 16 Mar 2020 15:25:42 +0100
|
|
|
|
Subject: [PATCH] Fix for temp folder definition in loader unit test
|
|
|
|
|
|
|
|
---
|
|
|
|
tests/unit/test_loader.py | 8 ++++----
|
|
|
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/tests/unit/test_loader.py b/tests/unit/test_loader.py
|
2021-01-08 13:41:50 +01:00
|
|
|
index 863e2182b9..5b23ad83e3 100644
|
2020-04-07 14:14:01 +02:00
|
|
|
--- a/tests/unit/test_loader.py
|
|
|
|
+++ b/tests/unit/test_loader.py
|
2021-01-08 13:41:50 +01:00
|
|
|
@@ -240,12 +240,12 @@ class LazyLoaderUtilsTest(TestCase):
|
2020-04-07 14:14:01 +02:00
|
|
|
def setUpClass(cls):
|
|
|
|
cls.opts = salt.config.minion_config(None)
|
2021-01-08 13:41:50 +01:00
|
|
|
cls.opts["grains"] = salt.loader.grains(cls.opts)
|
2020-04-07 14:14:01 +02:00
|
|
|
- if not os.path.isdir(TMP):
|
|
|
|
- os.makedirs(TMP)
|
|
|
|
+ if not os.path.isdir(RUNTIME_VARS.TMP):
|
|
|
|
+ os.makedirs(RUNTIME_VARS.TMP)
|
|
|
|
|
|
|
|
def setUp(self):
|
|
|
|
# Setup the module
|
|
|
|
- self.module_dir = tempfile.mkdtemp(dir=TMP)
|
|
|
|
+ self.module_dir = tempfile.mkdtemp(dir=RUNTIME_VARS.TMP)
|
2021-01-08 13:41:50 +01:00
|
|
|
self.module_file = os.path.join(
|
|
|
|
self.module_dir, "{}.py".format(self.module_name)
|
|
|
|
)
|
|
|
|
@@ -254,7 +254,7 @@ class LazyLoaderUtilsTest(TestCase):
|
2020-04-07 14:14:01 +02:00
|
|
|
fh.flush()
|
|
|
|
os.fsync(fh.fileno())
|
|
|
|
|
|
|
|
- self.utils_dir = tempfile.mkdtemp(dir=TMP)
|
|
|
|
+ self.utils_dir = tempfile.mkdtemp(dir=RUNTIME_VARS.TMP)
|
2021-01-08 13:41:50 +01:00
|
|
|
self.utils_file = os.path.join(self.utils_dir, "{}.py".format(self.utils_name))
|
|
|
|
with salt.utils.files.fopen(self.utils_file, "w") as fh:
|
|
|
|
fh.write(salt.utils.stringutils.to_str(loader_template_utils))
|
2020-04-07 14:14:01 +02:00
|
|
|
--
|
2021-01-08 13:41:50 +01:00
|
|
|
2.29.2
|
2020-04-07 14:14:01 +02:00
|
|
|
|
|
|
|
|