Merge "Yardstick install storperf update"
[yardstick.git] / yardstick / common / openstack_utils.py
index 2df8fa5..8787e60 100644 (file)
@@ -79,14 +79,20 @@ def get_session():
     except KeyError:
         return session.Session(auth=auth)
     else:
+        insecure = os.getenv('OS_INSECURE', '').lower() == 'true'
+        cacert = False if insecure else cacert
         return session.Session(auth=auth, verify=cacert)
 
 
 def get_endpoint(service_type, endpoint_type='publicURL'):
     auth = get_session_auth()
+    # for multi-region, we need to specify region
+    # when finding the endpoint
     return get_session().get_endpoint(auth=auth,
                                       service_type=service_type,
-                                      endpoint_type=endpoint_type)
+                                      endpoint_type=endpoint_type,
+                                      region_name=os.environ.get(
+                                          "OS_REGION_NAME"))
 
 
 # *********************************************