Fix broken swagger documentation and requirements.txt parsing

Change-Id: If9932b9d3ca19f0e4d53dfcd03cd35fdacde8f62
diff --git a/VERSION b/VERSION
index 5bc1cc4..23a63f5 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.2.7
+2.2.8
diff --git a/containers/chameleon/Dockerfile.chameleon b/containers/chameleon/Dockerfile.chameleon
index 059ef0a..ce1dd45 100644
--- a/containers/chameleon/Dockerfile.chameleon
+++ b/containers/chameleon/Dockerfile.chameleon
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 # xosproject/chameleon
-FROM xosproject/xos-base:2.2.7
+FROM xosproject/xos-base:2.2.8
 
 # xos-base already has protoc and dependencies installed
 
diff --git a/containers/xos/Dockerfile.client b/containers/xos/Dockerfile.client
index b5b3fcd..775524a 100644
--- a/containers/xos/Dockerfile.client
+++ b/containers/xos/Dockerfile.client
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 # xosproject/xos-client
-FROM xosproject/xos-libraries:2.2.7
+FROM xosproject/xos-libraries:2.2.8
 
 # Install XOS client
 COPY lib/xos-api /tmp/xos-api
diff --git a/containers/xos/Dockerfile.libraries b/containers/xos/Dockerfile.libraries
index 1c034b5..ad02937 100644
--- a/containers/xos/Dockerfile.libraries
+++ b/containers/xos/Dockerfile.libraries
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 # xosproject/xos-libraries
-FROM xosproject/xos-base:2.2.7
+FROM xosproject/xos-base:2.2.8
 
 # Add libraries
 COPY lib /opt/xos/lib
diff --git a/containers/xos/Dockerfile.synchronizer-base b/containers/xos/Dockerfile.synchronizer-base
index f219574..1fe2e05 100644
--- a/containers/xos/Dockerfile.synchronizer-base
+++ b/containers/xos/Dockerfile.synchronizer-base
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 # xosproject/xos-synchronizer-base
-FROM xosproject/xos-client:2.2.7
+FROM xosproject/xos-client:2.2.8
 
 COPY xos/synchronizers/new_base /opt/xos/synchronizers/new_base
 COPY xos/xos/logger.py /opt/xos/xos/logger.py
diff --git a/containers/xos/Dockerfile.xos-core b/containers/xos/Dockerfile.xos-core
index 687ed08..916d147 100644
--- a/containers/xos/Dockerfile.xos-core
+++ b/containers/xos/Dockerfile.xos-core
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 # xosproject/xos-core
-FROM xosproject/xos-libraries:2.2.7
+FROM xosproject/xos-libraries:2.2.8
 
 # Install XOS
 ADD xos /opt/xos
diff --git a/docs/Makefile b/docs/Makefile
index 60b3b5f..81a7564 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -45,19 +45,19 @@
 	ln -s ../../xos-tosca/docs xos-tosca
 
 kubernetes:
-	ln -s ../../xos-services/kubernetes-service/docs kubernetes
+	ln -s ../../xos_services/kubernetes-service/docs kubernetes
 
 openstack:
-	ln -s ../../xos-services/openstack/docs openstack
+	ln -s ../../xos_services/openstack/docs openstack
 
 onos:
-	ln -s ../../xos-services/onos-service/docs onos
+	ln -s ../../xos_services/onos-service/docs onos
 
 exampleservice:
-	ln -s ../../xos-services/exampleservice/docs exampleservice
+	ln -s ../../xos_services/exampleservice/docs exampleservice
 
 simpleexampleservice:
-	ln -s ../../xos-services/simpleexampleservice/docs simpleexampleservice
+	ln -s ../../xos_services/simpleexampleservice/docs simpleexampleservice
 
 
 # HOW TO
diff --git a/docs/scripts/swagger_docs.py b/docs/scripts/swagger_docs.py
index ffe36e7..1bf2b16 100644
--- a/docs/scripts/swagger_docs.py
+++ b/docs/scripts/swagger_docs.py
@@ -13,6 +13,7 @@
 # limitations under the License.
 
 import os
+import traceback
 from xosgenx.generator import XOSProcessor, XOSProcessorArgs
 
 CWD = OUTPUT_DIR = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
@@ -38,9 +39,9 @@
     args.quiet = False
     try:
         XOSProcessor.process(args)
-    except Exception, e:
+    except Exception:
         print "ERROR: Couldn't generate swagger specs"
-        print e
+        traceback.print_exc()
 
 def get_xproto_recursively(root):
     files = []
diff --git a/docs/venv-xosdocs.sh b/docs/venv-xosdocs.sh
index 7f34502..ca51fef 100755
--- a/docs/venv-xosdocs.sh
+++ b/docs/venv-xosdocs.sh
@@ -23,6 +23,7 @@
 if [ ! -d "$BASEDIR/$VENVDIR" ]; then
   echo "Setting up virtualenv for XOS Swagger Docs"
   virtualenv -q $BASEDIR/$VENVDIR --no-site-packages
+  source $BASEDIR/$VENVDIR/bin/activate
   pip install --upgrade pip
   echo "Virtualenv created."
 fi
@@ -35,4 +36,3 @@
 
 # install pip packages
 pip install -e $BASEDIR/$VENVDIR/../../lib/xos-genx
-pip install plyxproto jinja2 astunparse pyyaml colorama
diff --git a/lib/xos-config/setup.py b/lib/xos-config/setup.py
index 57f2939..5efef5c 100644
--- a/lib/xos-config/setup.py
+++ b/lib/xos-config/setup.py
@@ -32,7 +32,7 @@
     # parse a requirements.txt file, allowing for blank lines and comments
     requirements = []
     for line in open(filename):
-        if line and line.startswith("#"):
+        if line and not line.startswith("#"):
             requirements.append(line)
     return requirements
 
@@ -42,7 +42,8 @@
     version=version(),
     description="XOS Config Library",
     author="Matteo Scandolo",
-    author_email="teo@opennetworking.org",
+    author_email="cord-dev@opencord.org",
+    url="https://gerrit.opencord.org/gitweb?p=xos.git",
     classifiers=["License :: OSI Approved :: Apache Software License"],
     license="Apache v2",
     packages=["xosconfig"],
diff --git a/lib/xos-genx/setup.py b/lib/xos-genx/setup.py
index f1bc5a5..32bdff4 100644
--- a/lib/xos-genx/setup.py
+++ b/lib/xos-genx/setup.py
@@ -32,7 +32,7 @@
     # parse a requirements.txt file, allowing for blank lines and comments
     requirements = []
     for line in open(filename):
-        if line and line.startswith("#"):
+        if line and not line.startswith("#"):
             requirements.append(line)
     return requirements
 
@@ -42,7 +42,8 @@
     version=version(),
     description="XOS Generative Toolchain",
     author="Sapan Bhatia, Matteo Scandolo",
-    author_email="sapan@opennetworking.org, teo@opennetworking.org",
+    author_email="cord-dev@opencord.org",
+    url="https://gerrit.opencord.org/gitweb?p=xos.git",
     classifiers=["License :: OSI Approved :: Apache Software License"],
     license="Apache v2",
     packages=["xosgenx"],
diff --git a/lib/xos-genx/xosgenx/jinja2_extensions/base.py b/lib/xos-genx/xosgenx/jinja2_extensions/base.py
index f4929a9..7e10e7d 100644
--- a/lib/xos-genx/xosgenx/jinja2_extensions/base.py
+++ b/lib/xos-genx/xosgenx/jinja2_extensions/base.py
@@ -35,7 +35,7 @@
 
 
 def unquote(s):
-    if s.startswith('"') and s.endswith('"'):
+    if s and s.startswith('"') and s.endswith('"'):
         return s[1:-1]
     else:
         return s