1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 03:32:12 +00:00
iiab/roles/jupyterhub/templates/patch_await.sh
2021-09-02 19:30:41 +01:00

19 lines
791 B
Bash
Executable file

#!/bin/bash -x
# add await to asyncio change password function
SITE_PACKAGES=$({{ jupyterhub_venv }}/bin/getsite.py)
cat $SITE_PACKAGES/firstuseauthenticator/firstuseauthenticator.py |grep 'await self.render'
if [ $? -ne 0 ];then
echo Updating to \"await self.render\"
sed -i -e's/self.render/await self.render/' $SITE_PACKAGES/firstuseauthenticator/firstuseauthenticator.py
else
echo Await patch already applied. Skipping. . .
fi
cat $SITE_PACKAGES/firstuseauthenticator/firstuseauthenticator.py |grep data['data'].lower()'
if [ $? -ne 0 ];then
echo Updating to data['username'].lower()
sed -i -e's/data['username']/data['username'].lower()/' $SITE_PACKAGES/firstuseauthenticator/firstuseauthenticator.py
else
echo username.lower() patch already applied. Skipping. . .
fi