def nb_error(self):
         return self._nb_error
 
-    def incr_error(self):
+    def incr_error(self, msg=""):
         self._nb_error += 1
-        print("INCREMENTING ERRORS {}".format(self._nb_error))
+        if not msg:
+            print("INCREMENTING ERRORS {}".format(self._nb_error))
+        else:
+            print("INCREMENTING ERRORS {} [{}]".format(self._nb_error, msg))
 
     def get_tenant_uuid(self, tenant_name):
         return self.get_url("/v3/projects?name={}".format(tenant_name), authtoken=True, port=5000)["projects"][0]["id"]
 
                         overall_result = overall_result and True
                     else:
                         compare = "\033[1m\033[31mFalse\033[m"
-                        self.app.incr_error()
+                        self.app.incr_error(error_str)
                         overall_result = overall_result and False
                 else:
                     overall_result = overall_result and compare
 
 
 
 def __get_endpoint_url(name="keystone"):
-    with subprocess.Popen(["openstack", "endpoint", "show", name, "-f", "yaml"], stdout=subprocess.PIPE) as proc:
-        y = yaml.load(proc.stdout.read())
-        url = y['publicurl']
-        url = url.replace("http://", "")
-        url = url.replace("https://", "")
-        host, port = url.split(":", maxsplit=1)
-        port = port.split("/")[0]
-        return host, port
+    proc = subprocess.Popen(["openstack", "endpoint", "show", name, "-f", "yaml"], stdout=subprocess.PIPE)
+    y = yaml.load(proc.stdout.read())
+    url = y['publicurl']
+    url = url.replace("http://", "")
+    url = url.replace("https://", "")
+    host, port = url.split(":")
+    port = port.split("/")[0]
+    return host, port
 
 
 def test_federation():