Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 FIX: listdir method with pattern for SSH #5252

Conversation

giovannipizzi
Copy link
Member

The listdir method of the SSH transport plugin was using
glob.glob instead of self.glob when a pattern was specified.
This is wrong because it's listing files locally and not on the
remote.
The tests passed because they are running on localhost.
Also, this method is probably never called by AiiDA so it went unnoticed.

This commit fixes the issue. I'm not sure if there is a simple
way to fix the tests - probably we should run them against a
docker container or at least a chroot'ed folder? This might be
another issue to be opened though.

Fixes #5244

The `listdir` method of the SSH transport plugin was using
`glob.glob` instead of `self.glob` when a pattern was specified.
This is wrong because it's listing files locally and not on the
remote.
The tests passed because they are running on localhost.
Also, this method is probably never called by AiiDA so it went unnoticed.

This commit fixes the issue. I'm not sure if there is a simple
way to fix the tests - probably we should run them against a
docker container or at least a chroot'ed folder? This might be
another issue to be opened though.

Fixes aiidateam#5244
@codecov
Copy link

codecov bot commented Dec 7, 2021

Codecov Report

Merging #5252 (9b9260a) into develop (294fa68) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #5252   +/-   ##
========================================
  Coverage    81.38%   81.38%           
========================================
  Files          529      529           
  Lines        37008    37008           
========================================
  Hits         30117    30117           
  Misses        6891     6891           
Flag Coverage Δ
django 76.88% <100.00%> (ø)
sqlalchemy 75.83% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aiida/transports/plugins/ssh.py 79.91% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 294fa68...9b9260a. Read the comment docs.

@chrisjsewell chrisjsewell changed the title Fix listdir method with pattern for SSH 🐛 FIX: listdir method with pattern for SSH Dec 7, 2021
Copy link
Member

@chrisjsewell chrisjsewell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cheers

@chrisjsewell chrisjsewell merged commit 1890bab into aiidateam:develop Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SshTransport.listdir pattern handling is wrong
2 participants