From 224ed99ad072ee34a802cdb30483b236dcbfdb34 Mon Sep 17 00:00:00 2001 From: Germann Elsa Sylvia Date: Tue, 21 Feb 2023 09:41:46 +0100 Subject: [PATCH 1/2] ADD: possibility to whitelist some modules --- pmodules_tools/deps_status/check.py | 10 +++++++--- whitelist.txt | 10 ++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 whitelist.txt diff --git a/pmodules_tools/deps_status/check.py b/pmodules_tools/deps_status/check.py index 43c9bbe8..dd8037a6 100644 --- a/pmodules_tools/deps_status/check.py +++ b/pmodules_tools/deps_status/check.py @@ -20,9 +20,13 @@ def deps_status_check(module_cmd_process): def failure_handler(module, given_status): if len(module) != 0: - print('Module: "' + module + '" should be deployed as ' + given_status) - global failed_at_least_once - failed_at_least_once = True + with open("whitelist.txt") as file: + content = file.read() + name = module.split()[0].split("/")[0] + if name not in content: + print('Module: "' + module + '" should be deployed as ' + given_status) + global failed_at_least_once + failed_at_least_once = True def subprocess_cmd(cmd): diff --git a/whitelist.txt b/whitelist.txt new file mode 100644 index 00000000..fff99b85 --- /dev/null +++ b/whitelist.txt @@ -0,0 +1,10 @@ +OPAL +asciidoc +cp2k +cpmd +dynamo +fluka4 +gnuplot +gromacs +ior +ncview \ No newline at end of file From 1114ebbba11cb24a6b0e505666dbef11c3c9e4c0 Mon Sep 17 00:00:00 2001 From: Germann Elsa Sylvia Date: Tue, 21 Feb 2023 13:40:29 +0100 Subject: [PATCH 2/2] FIX: check ws line problem solved --- pmodules_tools/db_diff/check.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/pmodules_tools/db_diff/check.py b/pmodules_tools/db_diff/check.py index 6f39b3b0..72ae6319 100644 --- a/pmodules_tools/db_diff/check.py +++ b/pmodules_tools/db_diff/check.py @@ -31,19 +31,20 @@ def asciidoc_json_dump(list, name, steps, Pmodules_db_path): if len(list) > 1: list_range = len(list) - steps + 1 for index in range(0, list_range, steps): - matrix_row = [list[index].split()[0]] - if steps == 2: + if len(list[index]) > 1: + matrix_row = [list[index].split()[0]] + if steps == 2: + matrix_row += [ + list[index + 1].split()[1] + "->" + list[index].split()[1] + ] + else: + matrix_row += [list[index].split()[1]] matrix_row += [ - list[index + 1].split()[1] + "->" + list[index].split()[1] + list[index].split()[2], + " ".join(list[index].split()[3:]), + str(date.today()), ] - else: - matrix_row += [list[index].split()[1]] - matrix_row += [ - list[index].split()[2], - " ".join(list[index].split()[3:]), - str(date.today()), - ] - matrix.append(matrix_row) + matrix.append(matrix_row) # Update database file matrix += matrix_db