From e6ef0769fbbf5d62a8e3cbf4daf78e7efd400372 Mon Sep 17 00:00:00 2001 From: SRE - CEA Date: Wed, 28 Jun 2017 15:13:32 +0200 Subject: [PATCH] sat package: remove the .pyconf file in the root directory of salomeTools if there is any. (For example when launching jobs, a pyconf file describing the jobs can be here and is not useful). See https://codev-tuleap.cea.fr/plugins/tracker/?aid=8517 --- commands/package.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/commands/package.py b/commands/package.py index 68c7f19..a3b6859 100644 --- a/commands/package.py +++ b/commands/package.py @@ -684,6 +684,17 @@ def add_salomeTools(config, tmp_working_dir): local_pyconf_name = "local.pyconf" local_pyconf_dir = os.path.join(tmp_working_dir, "salomeTools", "data") local_pyconf_file = os.path.join(local_pyconf_dir, local_pyconf_name) + # Remove the .pyconf file in the root directory of salomeTools if there is + # any. (For example when launching jobs, a pyconf file describing the jobs + # can be here and is not useful) + files_or_dir_SAT = os.listdir(os.path.join(tmp_working_dir, "salomeTools")) + for file_or_dir in files_or_dir_SAT: + if file_or_dir.endswith(".pyconf"): + file_path = os.path.join(tmp_working_dir, + "salomeTools", + file_or_dir) + os.remove(file_path) + ff = open(local_pyconf_file, "w") ff.write(LOCAL_TEMPLATE) ff.close() -- 2.39.2