Commit 8f9b1715 authored by Marco Mariani's avatar Marco Mariani

recipe to expose pw_name, gr_name and so on

parent b333de07
......@@ -197,6 +197,7 @@ setup(name=name,
'trac = slapos.recipe.trac:Recipe',
'urlparse = slapos.recipe._urlparse:Recipe',
'uuid = slapos.recipe._uuid:Recipe',
'userinfo = slapos.recipe.userinfo:Recipe',
'vifib = slapos.recipe.vifib:Recipe',
'waitfor = slapos.recipe.waitfor:Recipe',
'webchecker = slapos.recipe.web_checker:Recipe',
......
# Provide POSIX information about the user
# that is currently running buildout
import grp
import os
import pwd
from slapos.recipe.librecipe import GenericBaseRecipe
class Recipe(GenericBaseRecipe):
def _options(self, options):
pinfo = pwd.getpwuid(os.getuid())
options['pw_name'] = pinfo.pw_name
options['pw_uid'] = pinfo.pw_uid
options['pw_gid'] = pinfo.pw_gid
options['pw_dir'] = pinfo.pw_dir
options['pw_shell'] = pinfo.pw_shell
ginfo = grp.getgrgid(os.getgid())
options['gr_name'] = ginfo.gr_name
options['gr_gid'] = ginfo.gr_gid
def install(self):
return []
update = install
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment