From e00b7bd91e7cae15ff0b58d556778de808676f26 Mon Sep 17 00:00:00 2001 From: Candice Date: Mon, 1 Jun 2020 15:02:21 +0200 Subject: [PATCH] luslab-umitools | Added parameter overriding function to umi_tools --- tools/umi_tools/groovy/NfUtils.groovy | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tools/umi_tools/groovy/NfUtils.groovy diff --git a/tools/umi_tools/groovy/NfUtils.groovy b/tools/umi_tools/groovy/NfUtils.groovy new file mode 100644 index 00000000..2804c535 --- /dev/null +++ b/tools/umi_tools/groovy/NfUtils.groovy @@ -0,0 +1,19 @@ +class NfUtils{ + def check_internal_overrides(String moduleName, Map params) + { + // get params set of keys + Set paramsKeySet = params.keySet() + + // Interate through and set internals to the correct parameter at runtime + paramsKeySet.each { + if(it.startsWith("internal_")) { + + def searchString = moduleName + '_' + it.replace('internal_', ''); + + if(paramsKeySet.contains(searchString)) { + params.replace(it, params.get(searchString)) + } + } + } + } +} \ No newline at end of file