1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

add python approach to getting site_pachages path

This commit is contained in:
George Hunt 2021-09-01 19:17:08 +01:00
parent ed163de935
commit 1a3ebc4675
3 changed files with 14 additions and 2 deletions

View file

@ -66,6 +66,12 @@
dest: "{{ jupyterhub_venv }}/bin/patch_await.sh"
mode: 0755
- name: Transfer a python program to fetch the site_packages path
template:
src: getsite.py
dest: "{{ jupyterhub_venv }}/bin/getsite.py"
mode: 0755
- name: Now run the installed script
ansible.builtin.shell: "{{ jupyterhub_venv }}/bin/patch_await.sh"

View file

@ -0,0 +1,7 @@
#!/opt/iiab/jupyterhub/bin/python3
import site
for path in iter(site.getsitepackages()):
if path.find('site') != -1:
print(path)

View file

@ -1,8 +1,7 @@
#!/bin/bash -x
# add await to asyncio change password function
SITE_PACKAGES=$({{ jupyterhub_venv }}/bin/python -m site|grep -v exist|grep site)
SITE_PACKAGES=${SITE_PACKAGES:5:-2}
SITE_PACKAGES=$({{ jupyterhub_venv }}/bin/getsite.py)
cat $SITE_PACKAGES/firstuseauthenticator/firstuseauthenticator.py |grep 'await self.render'
if [ $? -ne 0 ];then
echo Updating file