__package_pip: always use su for runas parameter.
This commit is contained in:
		
					parent
					
						
							
								f24d264480
							
						
					
				
			
			
				commit
				
					
						66c2e16a24
					
				
			
		
					 1 changed files with 5 additions and 6 deletions
				
			
		| 
						 | 
					@ -45,24 +45,23 @@ runasparam="$__object/parameter/runas"
 | 
				
			||||||
if [ -f "$runasparam" ]
 | 
					if [ -f "$runasparam" ]
 | 
				
			||||||
then
 | 
					then
 | 
				
			||||||
    runas=$(cat "$runasparam")
 | 
					    runas=$(cat "$runasparam")
 | 
				
			||||||
    runas_cmd=$(cat "$__global/explorer/sucmd")
 | 
					 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
    runas_cmd=""
 | 
					    runas=""
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
case "$state_should" in
 | 
					case "$state_should" in
 | 
				
			||||||
    present)
 | 
					    present)
 | 
				
			||||||
        if [ "$runas_cmd" ]
 | 
					        if [ "$runas" ]
 | 
				
			||||||
        then
 | 
					        then
 | 
				
			||||||
            echo "$runas_cmd $runas \"$pip install -q $name\""
 | 
					            echo "su -c \"$pip install -q $name\" $runas"
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
            echo $pip install -q "$name"
 | 
					            echo $pip install -q "$name"
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
    ;;
 | 
					    ;;
 | 
				
			||||||
    absent)
 | 
					    absent)
 | 
				
			||||||
        if [ "$runas_cmd" ]
 | 
					        if [ "$runas" ]
 | 
				
			||||||
        then
 | 
					        then
 | 
				
			||||||
            echo "$runas_cmd $runas \"$pip uninstall -q -y $name\""
 | 
					            echo "su -c \"$pip uninstall -q -y $name\" $runas"
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
            echo $pip uninstall -q -y "$name"
 | 
					            echo $pip uninstall -q -y "$name"
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue