add plugin infrastructure to user script

This commit is contained in:
johannes.kaufmann
2019-10-24 15:52:37 +02:00
parent 3cea0cb323
commit 07e487a199

View File

@@ -3,11 +3,20 @@ User management for tljh.
Supports minimal user & group management
"""
import pwd
import grp
import pwd
import subprocess
from os.path import expanduser
import pluggy
from tljh import hooks
# Set up plugin infrastructure
pm = pluggy.PluginManager('tljh')
pm.add_hookspecs(hooks)
pm.load_setuptools_entrypoints('tljh')
def ensure_user(username):
"""
@@ -28,6 +37,8 @@ def ensure_user(username):
username
])
pm.hook.tljh_new_user_create(username=username)
subprocess.check_call([
'chmod',
'o-rwx',