diff --git a/day2_hpcenv/7_cloud-hpc_challenges/1-hdf-cloud_mount-hpc-storage.ipynb b/day2_hpcenv/7_cloud-hpc_challenges/1-hdf-cloud_mount-hpc-storage.ipynb index 771502c78f14fb24c0301a2a43e5c544e21b3f29..fc37e13c063969b88bb077495268a7fabad50da0 100644 --- a/day2_hpcenv/7_cloud-hpc_challenges/1-hdf-cloud_mount-hpc-storage.ipynb +++ b/day2_hpcenv/7_cloud-hpc_challenges/1-hdf-cloud_mount-hpc-storage.ipynb @@ -131,8 +131,20 @@ "source": [ "def get_mount_command(access_token):\n", " _auth = \"https://uftp.fz-juelich.de:9112/UFTP_Auth/rest/auth/\"\n", - " _tr = unicore_client.Transport(access_token)\n", - " _info = _tr.get(url=_auth)\n", + " try:\n", + " _tr = unicore_client.Transport(access_token)\n", + " _info = _tr.get(url=_auth)\n", + " except AttributeError:\n", + " # pyunicore 1.0.0 has a different API\n", + " import pyunicore.credentials as unicore_credentials\n", + " credential = unicore_credentials.OIDCToken(access_token, None)\n", + " transport_kwargs = {\n", + " \"credential\": credential,\n", + " \"verify\": False,\n", + " \"timeout\": 30\n", + " }\n", + " _tr = unicore_client.Transport(**transport_kwargs)\n", + " _info = _tr.get(url=_auth)\n", " _uid = _info[\"JUDAC\"][\"uid\"]\n", "\n", " remote_base_dir = \"/p/home/jusers/%s\" % _uid\n", @@ -224,6 +236,14 @@ "# unmount\n", "!fusermount -u $HOME/uftp-mount-rw" ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c0c2fb3a-549c-4993-86d8-b2fc2c7dbdc5", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { @@ -242,7 +262,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.4" + "version": "3.11.3" } }, "nbformat": 4,