Add parameter --pyvenv.

This commit is contained in:
Darko Poljak 2016-04-13 22:32:15 +02:00
parent 4d5fa3087f
commit d9b2f1a540
3 changed files with 18 additions and 4 deletions

View file

@ -25,22 +25,29 @@ group_is="$(cat "$__object/explorer/group")"
state_should="$(cat "$__object/parameter/state")" state_should="$(cat "$__object/parameter/state")"
destination="/$__object_id"
owner="$(cat "$__object/parameter/owner")" owner="$(cat "$__object/parameter/owner")"
group="$(cat "$__object/parameter/group")" group="$(cat "$__object/parameter/group")"
mode="$(cat "$__object/parameter/mode")" mode="$(cat "$__object/parameter/mode")"
venvparams="$(cat "$__object/parameter/venvparams")"
[ "$state_should" = "$state_is" -a \ [ "$state_should" = "$state_is" -a \
"$owner" = "$owner_is" -a \ "$owner" = "$owner_is" -a \
"$group" = "$group_is" -a \ "$group" = "$group_is" -a \
-n "$mode" ] && exit 0 -n "$mode" ] && exit 0
destination="/$__object_id"
venvparams="$(cat "$__object/parameter/venvparams")"
pyvenvparam="$__object/parameter/pyvenv"
if [ -f "$pyvenvparam" ]
then
pyvenv=$(cat "$pyvenvparam")
else
pyvenv="pyvenv"
fi
case $state_should in case $state_should in
present) present)
if [ "$state_should" != "$state_is" ]; then if [ "$state_should" != "$state_is" ]; then
echo pyvenv $venvparams "$destination" echo $pyvenv $venvparams "$destination"
fi fi
if [ \( -n "$owner" -a "$owner_is" != "$owner" \) -o \ if [ \( -n "$owner" -a "$owner_is" != "$owner" \) -o \
\( -n "$group" -a "$group_is" != "$group" \) ]; then \( -n "$group" -a "$group_is" != "$group" \) ]; then

View file

@ -42,6 +42,9 @@ mode::
owner:: owner::
User to chown to User to chown to
pyvenv::
Use this specific pyvenv
venvparams:: venvparams::
Specific parameters to pass to pyvenv invocation Specific parameters to pass to pyvenv invocation
@ -52,6 +55,9 @@ EXAMPLES
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
__pyvenv /home/services/djangoenv __pyvenv /home/services/djangoenv
# Use specific pyvenv
__pyvenv /home/foo/fooenv --pyvenv /usr/local/bin/pyvenv-3.4
# Create python virtualenv for user foo. # Create python virtualenv for user foo.
__pyvenv /home/foo/fooenv --group foo --user foo __pyvenv /home/foo/fooenv --group foo --user foo

View file

@ -3,3 +3,4 @@ group
owner owner
mode mode
venvparams venvparams
pyvenv