Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Vincent Bechu
slapos
Commits
8f9b1715
Commit
8f9b1715
authored
Aug 28, 2014
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
recipe to expose pw_name, gr_name and so on
parent
b333de07
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
setup.py
setup.py
+1
-0
slapos/recipe/userinfo.py
slapos/recipe/userinfo.py
+29
-0
No files found.
setup.py
View file @
8f9b1715
...
...
@@ -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'
,
...
...
slapos/recipe/userinfo.py
0 → 100644
View file @
8f9b1715
# 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment