Skip to content

Commit 8d9a1de

Browse files
committed
Add deprecation for log_changes parameter of ModulesTool.unload and run_module
1 parent ba87ed0 commit 8d9a1de

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

easybuild/tools/modules.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,10 +1130,17 @@ def load(self, modules, mod_paths=None, purge=False, init_env=None, allow_reload
11301130
for mod in modules:
11311131
self.run_module('load', mod)
11321132

1133-
def unload(self, modules, hide_output=False):
1133+
def unload(self, modules, log_changes=None, *, hide_output=None):
11341134
"""
11351135
Unload all requested modules.
11361136
"""
1137+
if log_changes is not None:
1138+
if hide_output is not None:
1139+
raise EasyBuildError("Cannot specify both log_changes and hide_output")
1140+
self.log.deprecated("Parameter 'log_changes' is replaced by 'hide_output'", '6.0')
1141+
hide_output = not log_changes
1142+
elif hide_output is None:
1143+
hide_output = False # TODO: make this the default in 6.0
11371144
for mod in modules:
11381145
self.run_module('unload', mod, hide_output=hide_output)
11391146

@@ -1260,7 +1267,16 @@ def run_module(self, *args, **kwargs):
12601267
key, old_value, new_value)
12611268

12621269
debug_module_cmds = build_option('debug_module_cmds')
1263-
log_output = debug_module_cmds and not kwargs.get('hide_output', False)
1270+
log_changes = kwargs.get('log_changes')
1271+
hide_output = kwargs.get('hide_output')
1272+
1273+
if log_changes is not None:
1274+
if hide_output is not None:
1275+
raise EasyBuildError("Cannot specify both log_changes and hide_output")
1276+
self.log.deprecated("Parameter 'log_changes' is replaced by 'hide_output'", '6.0')
1277+
hide_output = not log_changes
1278+
1279+
log_output = debug_module_cmds and not hide_output
12641280
cmd_list = self.compose_cmd_list(args)
12651281
cmd = ' '.join(cmd_list)
12661282
# note: module commands are always run in dry mode, and are kept hidden in trace and dry run output

0 commit comments

Comments
 (0)