Creating python venv

Change-Id: I08829d5c506ff98355fb8360ed82bf7de9390d84
diff --git a/.gitignore b/.gitignore
index 4c357fa..73ddaa1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,3 +25,10 @@
 migrations/
 onboarding-docker-compose/
 key_import/
+
+# tmp files
+containers/chameleon/tmp.chameleon/
+containers/xos/local_certs.crt
+containers/xos/tmp.chameleon/
+containers/xos/BUILD/
+venv-xos/
\ No newline at end of file
diff --git a/containers/xos/pip_requirements.txt b/containers/xos/pip_requirements.txt
index b47ae86..5f2e5eb 100644
--- a/containers/xos/pip_requirements.txt
+++ b/containers/xos/pip_requirements.txt
@@ -18,7 +18,6 @@
 cachetools==1.1.6
 cached-property==1.3.0
 cffi==1.7.0
-chardet==2.0.1
 cliff==2.2.0
 cmd2==0.6.8
 colorama==0.2.5
@@ -78,6 +77,7 @@
 ndg-httpsclient==0.4.2
 netaddr==0.7.18
 netifaces==0.10.5
+nose==1.3.7
 oauth2client==3.0.0
 openapi-codec==1.0.0
 openstacksdk==0.9.4
@@ -109,7 +109,6 @@
 pycrypto==2.6.1
 pycurl==7.43.0
 pygraphviz==1.3.1
-pyinotify==0.9.6
 pyparsing==2.1.8
 python-cinderclient==1.8.0
 python-consul==0.7.0
diff --git a/scripts/setup_venv b/scripts/setup_venv
new file mode 100644
index 0000000..8c5f50d
--- /dev/null
+++ b/scripts/setup_venv
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+BASEDIR=$(pwd)
+REQUIREMENTS=$BASEDIR/containers/xos/pip_requirements.txt
+VENVDIR=venv-xos
+
+echo $BASEDIR
+echo $REQUIREMENTS
+echo $VENVDIR
+
+# create venv if it's not yet there
+if [ ! -d "$BASEDIR/$VENVDIR" ]; then
+    echo "Setting up virtualenv for XOS"
+    virtualenv -q $BASEDIR/$VENVDIR --no-site-packages
+    pip install --upgrade pip
+    echo "Virtualenv created."
+fi
+
+# activate the virtual env
+if [ ! $VIRTUAL_ENV ]; then
+    source $BASEDIR/$VENVDIR/bin/activate
+    echo "Virtualenv activated."
+fi
+
+# install pip requirements
+if pip install -r $REQUIREMENTS
+  then
+    echo "Requirements installed."
+    echo "Virtualenv ready"
+  else
+    echo "An error occurred"
+fi