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:
parent
ed163de935
commit
1a3ebc4675
3 changed files with 14 additions and 2 deletions
|
@ -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"
|
||||
|
||||
|
|
7
roles/jupyterhub/templates/getsite.py
Executable file
7
roles/jupyterhub/templates/getsite.py
Executable 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)
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue