From 90dd262c19d7387ef6b438aea5e6eb13f3fd609d Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Tue, 10 Nov 2015 12:22:03 -0500 Subject: [PATCH] fail if devstack attempts to be run under virtualenv This has come up on the mailing list recently, we should just fail early and explicitly so that people don't get way down this path and not realize it's never going to work. Change-Id: I8a7f001adf3a5244b8655858ebd5fc7014a4af55 --- stack.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/stack.sh b/stack.sh index 68b932e4b1..825ed968f3 100755 --- a/stack.sh +++ b/stack.sh @@ -93,6 +93,20 @@ if [[ $EUID -eq 0 ]]; then exit 1 fi +# OpenStack is designed to run at a system level, with system level +# installation of python packages. It does not support running under a +# virtual env, and will fail in really odd ways if you do this. Make +# this explicit as it has come up on the mailing list. +if [[ -n "$VIRTUAL_ENV" ]]; then + echo "You appear to be running under a python virtualenv." + echo "DevStack does not support this, as we my break the" + echo "virtualenv you are currently in by modifying " + echo "external system-level components the virtualenv relies on." + echo "We reccommend you use a separate virtual-machine if " + echo "you are worried about DevStack taking over your system." + exit 1 +fi + # Provide a safety switch for devstack. If you do a lot of devstack, # on a lot of different environments, you sometimes run it on the # wrong box. This makes there be a way to prevent that.