From 66c2e16a24df102539e462957bbf8246dd479910 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 21 Apr 2016 08:24:47 +0200 Subject: [PATCH] __package_pip: always use su for runas parameter. --- cdist/conf/type/__package_pip/gencode-remote | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cdist/conf/type/__package_pip/gencode-remote b/cdist/conf/type/__package_pip/gencode-remote index b9a52efc..ccfdb92b 100644 --- a/cdist/conf/type/__package_pip/gencode-remote +++ b/cdist/conf/type/__package_pip/gencode-remote @@ -45,24 +45,23 @@ runasparam="$__object/parameter/runas" if [ -f "$runasparam" ] then runas=$(cat "$runasparam") - runas_cmd=$(cat "$__global/explorer/sucmd") else - runas_cmd="" + runas="" fi case "$state_should" in present) - if [ "$runas_cmd" ] + if [ "$runas" ] then - echo "$runas_cmd $runas \"$pip install -q $name\"" + echo "su -c \"$pip install -q $name\" $runas" else echo $pip install -q "$name" fi ;; absent) - if [ "$runas_cmd" ] + if [ "$runas" ] then - echo "$runas_cmd $runas \"$pip uninstall -q -y $name\"" + echo "su -c \"$pip uninstall -q -y $name\" $runas" else echo $pip uninstall -q -y "$name" fi