Addresses lp#933845
* Changed config to use catalog type instead of catalog name

Change-Id: I183ae3a9a56b16ae8191f30523aa68777b7158cc
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index da35c8f..097cfb9 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -9,7 +9,7 @@
 ssh_timeout=300
 build_interval=10
 build_timeout=600
-catalog_name=nova
+catalog_type=compute
 
 [environment]
 image_ref=3
diff --git a/tempest/common/rest_client.py b/tempest/common/rest_client.py
index 754a1f6..1530313 100644
--- a/tempest/common/rest_client.py
+++ b/tempest/common/rest_client.py
@@ -68,7 +68,7 @@
 
             mgmt_url = None
             for ep in auth_data['serviceCatalog']:
-                if ep["name"] == service:
+                if ep["type"] == service:
                     mgmt_url = ep['endpoints'][0]['publicURL']
                     # See LP#920817. The tenantId is *supposed*
                     # to be returned for each endpoint accorsing to the
diff --git a/tempest/config.py b/tempest/config.py
index 960ff74..2995447 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -89,9 +89,9 @@
         return float(self.get("build_timeout", 300))
 
     @property
-    def catalog_name(self):
+    def catalog_type(self):
         """Catalog name of the Nova service."""
-        return self.get("catalog_name", 'nova')
+        return self.get("catalog_type", 'compute')
 
 
 class EnvironmentConfig(object):
diff --git a/tempest/services/nova/json/extensions_client.py b/tempest/services/nova/json/extensions_client.py
index 5f2cac4..8f26847 100644
--- a/tempest/services/nova/json/extensions_client.py
+++ b/tempest/services/nova/json/extensions_client.py
@@ -6,9 +6,9 @@
 
     def __init__(self, config, username, key, auth_url, tenant_name=None):
         self.config = config
-        catalog_name = self.config.nova.catalog_name
+        catalog_type = self.config.nova.catalog_type
         self.client = rest_client.RestClient(config, username, key,
-                                             auth_url, catalog_name,
+                                             auth_url, catalog_type,
                                              tenant_name)
 
     def list_extensions(self):
diff --git a/tempest/services/nova/json/flavors_client.py b/tempest/services/nova/json/flavors_client.py
index b592781..990990b 100644
--- a/tempest/services/nova/json/flavors_client.py
+++ b/tempest/services/nova/json/flavors_client.py
@@ -6,9 +6,9 @@
 
     def __init__(self, config, username, key, auth_url, tenant_name=None):
         self.config = config
-        catalog_name = self.config.nova.catalog_name
+        catalog_type = self.config.nova.catalog_type
         self.client = rest_client.RestClient(config, username, key,
-                                             auth_url, catalog_name,
+                                             auth_url, catalog_type,
                                              tenant_name)
 
     def list_flavors(self, params=None):
diff --git a/tempest/services/nova/json/floating_ips_client.py b/tempest/services/nova/json/floating_ips_client.py
index 4a9f9eb..8a179b9 100644
--- a/tempest/services/nova/json/floating_ips_client.py
+++ b/tempest/services/nova/json/floating_ips_client.py
@@ -6,9 +6,9 @@
 class FloatingIPsClient(object):
     def __init__(self, config, username, key, auth_url, tenant_name=None):
         self.config = config
-        catalog_name = self.config.nova.catalog_name
+        catalog_type = self.config.nova.catalog_type
         self.client = rest_client.RestClient(config, username, key,
-                                             auth_url, catalog_name,
+                                             auth_url, catalog_type,
                                              tenant_name)
         self.headers = {'Content-Type': 'application/json',
                         'Accept': 'application/json'}
diff --git a/tempest/services/nova/json/images_client.py b/tempest/services/nova/json/images_client.py
index 435e2fa..e4d2c65 100644
--- a/tempest/services/nova/json/images_client.py
+++ b/tempest/services/nova/json/images_client.py
@@ -8,9 +8,9 @@
 
     def __init__(self, config, username, key, auth_url, tenant_name=None):
         self.config = config
-        catalog_name = self.config.nova.catalog_name
+        catalog_type = self.config.nova.catalog_type
         self.client = rest_client.RestClient(config, username, key,
-                                             auth_url, catalog_name,
+                                             auth_url, catalog_type,
                                              tenant_name)
 
         self.build_interval = self.config.nova.build_interval
diff --git a/tempest/services/nova/json/keypairs_client.py b/tempest/services/nova/json/keypairs_client.py
index 88dfcfe..59057ab 100644
--- a/tempest/services/nova/json/keypairs_client.py
+++ b/tempest/services/nova/json/keypairs_client.py
@@ -6,9 +6,9 @@
 
     def __init__(self, config, username, key, auth_url, tenant_name=None):
         self.config = config
-        catalog_name = self.config.nova.catalog_name
+        catalog_type = self.config.nova.catalog_type
         self.client = rest_client.RestClient(config, username, key,
-                                             auth_url, catalog_name,
+                                             auth_url, catalog_type,
                                              tenant_name)
         self.headers = {'Content-Type': 'application/json',
                         'Accept': 'application/json'}
diff --git a/tempest/services/nova/json/limits_client.py b/tempest/services/nova/json/limits_client.py
index 9b96fb4..93be33e 100644
--- a/tempest/services/nova/json/limits_client.py
+++ b/tempest/services/nova/json/limits_client.py
@@ -6,9 +6,9 @@
 
     def __init__(self, config, username, key, auth_url, tenant_name=None):
         self.config = config
-        catalog_name = self.config.nova.catalog_name
+        catalog_type = self.config.nova.catalog_type
         self.client = rest_client.RestClient(config, username, key,
-                                             auth_url, catalog_name,
+                                             auth_url, catalog_type,
                                              tenant_name)
 
     def get_limits(self):
diff --git a/tempest/services/nova/json/security_groups_client.py b/tempest/services/nova/json/security_groups_client.py
index 05ba61f..34cf807 100644
--- a/tempest/services/nova/json/security_groups_client.py
+++ b/tempest/services/nova/json/security_groups_client.py
@@ -6,9 +6,9 @@
 
     def __init__(self, config, username, key, auth_url, tenant_name=None):
         self.config = config
-        catalog_name = self.config.nova.catalog_name
+        catalog_type = self.config.nova.catalog_type
         self.client = rest_client.RestClient(config, username, key,
-                                             auth_url, catalog_name,
+                                             auth_url, catalog_type,
                                              tenant_name)
 
     def list_security_groups(self, params=None):
diff --git a/tempest/services/nova/json/servers_client.py b/tempest/services/nova/json/servers_client.py
index 7607a37..605bd46 100644
--- a/tempest/services/nova/json/servers_client.py
+++ b/tempest/services/nova/json/servers_client.py
@@ -8,9 +8,9 @@
 
     def __init__(self, config, username, key, auth_url, tenant_name=None):
         self.config = config
-        catalog_name = self.config.nova.catalog_name
+        catalog_type = self.config.nova.catalog_type
         self.client = rest_client.RestClient(config, username, key,
-                                             auth_url, catalog_name,
+                                             auth_url, catalog_type,
                                              tenant_name)
 
         self.build_interval = self.config.nova.build_interval