diff --git a/src/aiida/cmdline/commands/cmd_computer.py b/src/aiida/cmdline/commands/cmd_computer.py index 41182eebfc..084f2f6541 100644 --- a/src/aiida/cmdline/commands/cmd_computer.py +++ b/src/aiida/cmdline/commands/cmd_computer.py @@ -62,14 +62,24 @@ def _computer_test_no_unexpected_output(transport, scheduler, authinfo, computer This can happen if e.g. there is some spurious command in the .bashrc or .bash_profile that is not guarded in case of non-interactive shells. + Note: This test is irrelevant if the transport plugin does not support command execution. :param transport: an open transport :param scheduler: the corresponding scheduler class :param authinfo: the AuthInfo object (from which one can get computer and aiidauser) :return: tuple of boolean indicating success or failure and an optional string message """ - # Execute a command that should not return any error - retval, stdout, stderr = transport.exec_command_wait('echo -n') + # Execute a command that should not return any error, except ``NotImplementedError`` + # since not all transport plugins implement remote command execution. + try: + retval, stdout, stderr = transport.exec_command_wait('echo -n') + except NotImplementedError: + return ( + True, + f'Skipped, remote command execution is not implemented for the ' + f'`{computer.transport_type}` transport plugin', + ) + if retval != 0: return False, f'The command `echo -n` returned a non-zero return code ({retval})'