Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Engine: Fix bug in upload calculation for
PortableCode
with SSH (#6519
) When a `CalcJob` would be run with a `PortableCode` using a computer configured with the `core.ssh` transport plugin, the upload task would except. The `aiida.engine.daemon.execmanager.upload_calculation` method is passing `pathlib.Path` objects to the transport interface which is not supported. By chance this does not raise an exception when using the `LocalTransport`, but the `SshTransport` passes these values to the paramiko library which does choke on anything but strings. The use of a `PortableCode` was tested for in the unit test `tests/engine/processes/calcjobs/test_calc_job.py:test_portable_code` but this would only use a local transport and thus the bug would not appear. Parametrizing it to also use the `SshTransport` wouldn't help since the test uses `metadata.dry_run = True`, whose implementation will always swap the transport to a local one, still avoiding the bugged code pathway. Instead a test is added that directly calls `upload_calculation` which parametrizes over all installed transport plugins and uses a `PortableCode`. This confirmed the bug. The `upload_calculation` method is updated to ensure casting all `pathlib.Path` objects to `str` before passing it to the transport. Cherry-pick: f992443
- Loading branch information