From dce0b075d35fa29f9eff0a73ba116a71b3c10895 Mon Sep 17 00:00:00 2001 From: George Hunt Date: Sun, 29 Aug 2021 22:33:48 +0100 Subject: [PATCH] add a script to fix firseuseauthenticator change-password function --- roles/jupyterhub/tasks/install.yml | 10 ++++++++++ roles/jupyterhub/templates/patch_await.sh | 11 +++++++++++ 2 files changed, 21 insertions(+) create mode 100755 roles/jupyterhub/templates/patch_await.sh diff --git a/roles/jupyterhub/tasks/install.yml b/roles/jupyterhub/tasks/install.yml index 1f71ba454..cf9c21672 100644 --- a/roles/jupyterhub/tasks/install.yml +++ b/roles/jupyterhub/tasks/install.yml @@ -60,6 +60,16 @@ src: jupyterhub.service dest: /etc/systemd/system/ +- name: Fix the async bug in firseuseauthenticator + template: + src: patch_await.sh + dest: "{{ jupyterhub_venv }}/bin/patch_await.sh" + mode: 0755 + +- name: Now run the installed script + ansible.builtin.shell: + cmd: "{{ jupyterhub_venv }}/bin/patch_await.sh" + # RECORD JupyterHub AS INSTALLED diff --git a/roles/jupyterhub/templates/patch_await.sh b/roles/jupyterhub/templates/patch_await.sh new file mode 100755 index 000000000..df6d438ed --- /dev/null +++ b/roles/jupyterhub/templates/patch_await.sh @@ -0,0 +1,11 @@ +#!/bin/bash -x +# add await to asyncio change password function + +cat /opt/iiab/jupyterhub/lib/python3.7/site-packages/firstuseauthenticator/firstuseauthenticator.py |grep 'await self.render' +if [ $? -ne 0 ];then + echo Updating file + sed -i -e's/self.render/await self.render/' /opt/iiab/jupyterhub/lib/python3.7/site-packages/firstuseauthenticator/firstuseauthenticator.py +else + echo Patch already applied. Skipping. . . +fi +