ucphhpc / migrid-sync

MiGrid workspace where master branch is kept strictly in sync with SF upstream svn repo. Any development or experiments should use a branch. You probably want to fork your own clone or work e.g. on the edge branch if you wish to contribute.
GNU General Public License v2.0
4 stars 4 forks source link

Fix ssh key generation on python3 #108

Closed jonasbardino closed 3 months ago

jonasbardino commented 3 months ago

Backport NativeStringIO wrapper helper from experimental to shared.compat and start using it in shared.ssh where we really need a platform-specific StringIO to write generated ssh keys to. The existing solution does NOT work on py3 and is a missing piece at least in the cloud integration and probably also in the jupyter integration there.

Migrate the old deprecated base64.decodestring in shared.ssh to use the modern b64decode, which happens to also just work without string tweaks in this case.

Implemented unit tests for the paramiko key handling parts of shared.ssh functions. The remaining ssh functions require an actual ssh service to test against so they are left out of the unit tests for now.

jonasbardino commented 3 months ago

Manually merged through svn.

albu-diku commented 3 months ago

@jonasbardino realise this already landed but I felt it worth a formal review and I think the comments are useful hence pinging you explicitly to make sure you find them :)

jonasbardino commented 3 months ago

Yes, it's always valuable with feedback to handle sooner or later. So I usually make an open invitation to review in the form of a review request to the sci -> ops group, even if it doesn't always make it for the actual merge.