Merge "Rename references to compute security groups client"
diff --git a/tempest/api/compute/admin/test_security_groups.py b/tempest/api/compute/admin/test_security_groups.py
index b0a3086..e31129b 100644
--- a/tempest/api/compute/admin/test_security_groups.py
+++ b/tempest/api/compute/admin/test_security_groups.py
@@ -28,7 +28,7 @@
     @classmethod
     def setup_clients(cls):
         super(SecurityGroupsTestAdminJSON, cls).setup_clients()
-        cls.adm_client = cls.os_adm.security_groups_client
+        cls.adm_client = cls.os_adm.compute_security_groups_client
         cls.client = cls.security_groups_client
 
     def _delete_security_group(self, securitygroup_id, admin=True):
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 5bc0769..2321b4e 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -69,7 +69,7 @@
         cls.floating_ips_client = cls.os.compute_floating_ips_client
         cls.keypairs_client = cls.os.keypairs_client
         cls.security_group_rules_client = cls.os.security_group_rules_client
-        cls.security_groups_client = cls.os.security_groups_client
+        cls.security_groups_client = cls.os.compute_security_groups_client
         cls.quotas_client = cls.os.quotas_client
         cls.quota_classes_client = cls.os.quota_classes_client
         cls.compute_networks_client = cls.os.compute_networks_client
diff --git a/tempest/api/compute/test_authorization.py b/tempest/api/compute/test_authorization.py
index 436ed2f..4f2bc04 100644
--- a/tempest/api/compute/test_authorization.py
+++ b/tempest/api/compute/test_authorization.py
@@ -51,13 +51,14 @@
         cls.images_client = cls.os.images_client
         cls.glance_client = cls.os.image_client
         cls.keypairs_client = cls.os.keypairs_client
-        cls.security_client = cls.os.security_groups_client
+        cls.security_client = cls.os.compute_security_groups_client
         cls.rule_client = cls.os.security_group_rules_client
 
         cls.alt_client = cls.alt_manager.servers_client
         cls.alt_images_client = cls.alt_manager.images_client
         cls.alt_keypairs_client = cls.alt_manager.keypairs_client
-        cls.alt_security_client = cls.alt_manager.security_groups_client
+        cls.alt_security_client = (
+            cls.alt_manager.compute_security_groups_client)
         cls.alt_rule_client = cls.alt_manager.security_group_rules_client
 
     @classmethod
diff --git a/tempest/clients.py b/tempest/clients.py
index 0a3f2dd..955748b 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -50,7 +50,7 @@
 from tempest_lib.services.compute.security_group_default_rules_client import \
     SecurityGroupDefaultRulesClient
 from tempest_lib.services.compute.security_groups_client import \
-    SecurityGroupsClient
+    SecurityGroupsClient as ComputeSecurityGroupsClient
 from tempest_lib.services.compute.services_client import ServicesClient
 from tempest_lib.services.compute.snapshots_client import \
     SnapshotsClient as ComputeSnapshotsClient
@@ -358,7 +358,7 @@
             self.auth_provider, **params)
         self.security_group_rules_client = SecurityGroupRulesClient(
             self.auth_provider, **params)
-        self.security_groups_client = SecurityGroupsClient(
+        self.compute_security_groups_client = ComputeSecurityGroupsClient(
             self.auth_provider, **params)
         self.interfaces_client = InterfacesClient(self.auth_provider,
                                                   **params)
diff --git a/tempest/cmd/cleanup_service.py b/tempest/cmd/cleanup_service.py
index 98af9c1..4fd92ab 100644
--- a/tempest/cmd/cleanup_service.py
+++ b/tempest/cmd/cleanup_service.py
@@ -269,7 +269,7 @@
 class SecurityGroupService(BaseService):
     def __init__(self, manager, **kwargs):
         super(SecurityGroupService, self).__init__(kwargs)
-        self.client = manager.security_groups_client
+        self.client = manager.compute_security_groups_client
 
     def list(self):
         client = self.client
diff --git a/tempest/common/validation_resources.py b/tempest/common/validation_resources.py
index 1908b68..f526299 100644
--- a/tempest/common/validation_resources.py
+++ b/tempest/common/validation_resources.py
@@ -23,7 +23,7 @@
 
 
 def create_ssh_security_group(os, add_rule=False):
-    security_groups_client = os.security_groups_client
+    security_groups_client = os.compute_security_groups_client
     security_group_rules_client = os.security_group_rules_client
     sg_name = data_utils.rand_name('securitygroup-')
     sg_description = data_utils.rand_name('description-')
@@ -81,7 +81,7 @@
                 if not has_exception:
                     has_exception = exc
         if 'security_group' in validation_data:
-            security_group_client = os.security_groups_client
+            security_group_client = os.compute_security_groups_client
             sec_id = validation_data['security_group']['id']
             try:
                 security_group_client.delete_security_group(sec_id)
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 24877f4..c304136 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -55,7 +55,8 @@
         cls.images_client = cls.manager.images_client
         cls.keypairs_client = cls.manager.keypairs_client
         # Nova security groups client
-        cls.security_groups_client = cls.manager.security_groups_client
+        cls.compute_security_groups_client = (
+            cls.manager.compute_security_groups_client)
         cls.security_group_rules_client = (
             cls.manager.security_group_rules_client)
         cls.servers_client = cls.manager.servers_client
@@ -286,7 +287,7 @@
         return volume
 
     def _create_loginable_secgroup_rule(self, secgroup_id=None):
-        _client = self.security_groups_client
+        _client = self.compute_security_groups_client
         _client_rules = self.security_group_rules_client
         if secgroup_id is None:
             sgs = _client.list_security_groups()['security_groups']
@@ -328,13 +329,14 @@
         # Create security group
         sg_name = data_utils.rand_name(self.__class__.__name__)
         sg_desc = sg_name + " description"
-        secgroup = self.security_groups_client.create_security_group(
+        secgroup = self.compute_security_groups_client.create_security_group(
             name=sg_name, description=sg_desc)['security_group']
         self.assertEqual(secgroup['name'], sg_name)
         self.assertEqual(secgroup['description'], sg_desc)
-        self.addCleanup(self.delete_wrapper,
-                        self.security_groups_client.delete_security_group,
-                        secgroup['id'])
+        self.addCleanup(
+            self.delete_wrapper,
+            self.compute_security_groups_client.delete_security_group,
+            secgroup['id'])
 
         # Add rules to the security group
         self._create_loginable_secgroup_rule(secgroup['id'])
diff --git a/tempest/scenario/test_large_ops.py b/tempest/scenario/test_large_ops.py
index f45fb3a..b549ecb 100644
--- a/tempest/scenario/test_large_ops.py
+++ b/tempest/scenario/test_large_ops.py
@@ -85,11 +85,12 @@
         # Explicitly create secgroup to avoid cleanup at the end of testcases.
         # Since no traffic is tested, we don't need to actually add rules to
         # secgroup
-        secgroup = self.security_groups_client.create_security_group(
+        secgroup = self.compute_security_groups_client.create_security_group(
             name='secgroup-%s' % name,
             description='secgroup-desc-%s' % name)['security_group']
-        self.addCleanupClass(self.security_groups_client.delete_security_group,
-                             secgroup['id'])
+        self.addCleanupClass(
+            self.compute_security_groups_client.delete_security_group,
+            secgroup['id'])
         create_kwargs = {
             'min_count': CONF.scenario.large_ops_number,
             'security_groups': [{'name': secgroup['name']}]
diff --git a/tempest/stress/actions/ssh_floating.py b/tempest/stress/actions/ssh_floating.py
index 6bac570..4f8c6bd 100644
--- a/tempest/stress/actions/ssh_floating.py
+++ b/tempest/stress/actions/ssh_floating.py
@@ -91,7 +91,7 @@
         self.logger.info("deleted %s" % self.server_id)
 
     def _create_sec_group(self):
-        sec_grp_cli = self.manager.security_groups_client
+        sec_grp_cli = self.manager.compute_security_groups_client
         s_name = data_utils.rand_name('sec_grp')
         s_description = data_utils.rand_name('desc')
         self.sec_grp = sec_grp_cli.create_security_group(
@@ -103,7 +103,7 @@
                     from_port=-1, to_port=-1)
 
     def _destroy_sec_grp(self):
-        sec_grp_cli = self.manager.security_groups_client
+        sec_grp_cli = self.manager.compute_security_groups_client
         sec_grp_cli.delete_security_group(self.sec_grp['id'])
 
     def _create_floating_ip(self):
diff --git a/tempest/stress/actions/volume_attach_verify.py b/tempest/stress/actions/volume_attach_verify.py
index fa0bb8b..2a23291 100644
--- a/tempest/stress/actions/volume_attach_verify.py
+++ b/tempest/stress/actions/volume_attach_verify.py
@@ -54,7 +54,7 @@
         self.logger.info("deleted server: %s" % self.server_id)
 
     def _create_sec_group(self):
-        sec_grp_cli = self.manager.security_groups_client
+        sec_grp_cli = self.manager.compute_security_groups_client
         s_name = data_utils.rand_name('sec_grp')
         s_description = data_utils.rand_name('desc')
         self.sec_grp = sec_grp_cli.create_security_group(
@@ -66,7 +66,7 @@
                     from_port=-1, to_port=-1)
 
     def _destroy_sec_grp(self):
-        sec_grp_cli = self.manager.security_groups_client
+        sec_grp_cli = self.manager.compute_security_groups_client
         sec_grp_cli.delete_security_group(self.sec_grp['id'])
 
     def _create_floating_ip(self):
diff --git a/tempest/stress/cleanup.py b/tempest/stress/cleanup.py
index 993359d..d252b84 100644
--- a/tempest/stress/cleanup.py
+++ b/tempest/stress/cleanup.py
@@ -48,7 +48,7 @@
         except Exception:
             pass
 
-    secgrp_client = admin_manager.security_groups_client
+    secgrp_client = admin_manager.compute_security_groups_client
     secgrp = (secgrp_client.list_security_groups(all_tenants=True)
               ['security_groups'])
     secgrp_del = [grp for grp in secgrp if grp['name'] != 'default']