Merge "Do not use unnecessary instance variable in compute and volume"
diff --git a/releasenotes/notes/remove-deprecated-compute-validation-config-options-e3d1b89ce074d71c.yaml b/releasenotes/notes/remove-deprecated-compute-validation-config-options-e3d1b89ce074d71c.yaml
new file mode 100644
index 0000000..8665b8b
--- /dev/null
+++ b/releasenotes/notes/remove-deprecated-compute-validation-config-options-e3d1b89ce074d71c.yaml
@@ -0,0 +1,14 @@
+---
+upgrade:
+  - |
+    Below deprecated config options from compute group have been removed.
+    Corresponding config options already been available in validation group.
+
+    - ``compute.use_floatingip_for_ssh`` (available as ``validation.connect_method``)
+    - ``compute.ssh_auth_method`` (available as ``validation.auth_method``)
+    - ``compute.image_ssh_password`` (available as ``validation.image_ssh_password``)
+    - ``compute.ssh_shell_prologue`` (available as ``validation.ssh_shell_prologue``)
+    - ``compute.ping_size `` (available as ``validation.ping_size``)
+    - ``compute.ping_count `` (available as ``validation.ping_count``)
+    - ``compute.floating_ip_range `` (available as ``validation.floating_ip_range``)
+
diff --git a/releasenotes/source/index.rst b/releasenotes/source/index.rst
index 242d133..cea76b4 100644
--- a/releasenotes/source/index.rst
+++ b/releasenotes/source/index.rst
@@ -6,6 +6,7 @@
     :maxdepth: 1
 
     unreleased
+    v15.0.0
     v14.0.0
     v13.0.0
     v12.0.0
diff --git a/releasenotes/source/v15.0.0.rst b/releasenotes/source/v15.0.0.rst
new file mode 100644
index 0000000..2ee1894
--- /dev/null
+++ b/releasenotes/source/v15.0.0.rst
@@ -0,0 +1,6 @@
+=====================
+v15.0.0 Release Notes
+=====================
+
+.. release-notes:: 15.0.0 Release Notes
+   :version: 15.0.0
diff --git a/tempest/api/compute/admin/test_flavors.py b/tempest/api/compute/admin/test_flavors.py
index f3a5e01..0a9db46 100644
--- a/tempest/api/compute/admin/test_flavors.py
+++ b/tempest/api/compute/admin/test_flavors.py
@@ -80,20 +80,17 @@
         flavor_name = data_utils.rand_name(self.flavor_name_prefix)
 
         # Create the flavor
-        flavor = self.create_flavor(name=flavor_name,
-                                    ram=self.ram, vcpus=self.vcpus,
-                                    disk=self.disk,
-                                    ephemeral=self.ephemeral,
-                                    swap=self.swap,
-                                    rxtx_factor=self.rxtx)
-        flag = False
-        # Verify flavor is retrieved
-        flavors = self.admin_flavors_client.list_flavors(
+        self.create_flavor(name=flavor_name,
+                           ram=self.ram, vcpus=self.vcpus,
+                           disk=self.disk,
+                           ephemeral=self.ephemeral,
+                           swap=self.swap,
+                           rxtx_factor=self.rxtx)
+
+        # Check if flavor is present in list
+        flavors_list = self.admin_flavors_client.list_flavors(
             detail=True)['flavors']
-        for flavor in flavors:
-            if flavor['name'] == flavor_name:
-                flag = True
-        self.assertTrue(flag)
+        self.assertIn(flavor_name, [f['name'] for f in flavors_list])
 
     @decorators.idempotent_id('63dc64e6-2e79-4fdf-868f-85500d308d66')
     def test_create_list_flavor_without_extra_data(self):
@@ -128,13 +125,12 @@
         verify_flavor_response_extension(flavor)
 
         # Check if flavor is present in list
-        flag = False
-        flavors = self.flavors_client.list_flavors(detail=True)['flavors']
-        for flavor in flavors:
-            if flavor['name'] == flavor_name:
-                verify_flavor_response_extension(flavor)
-                flag = True
-        self.assertTrue(flag)
+        flavors_list = [
+            f for f in self.flavors_client.list_flavors(detail=True)['flavors']
+            if f['name'] == flavor_name
+        ]
+        self.assertNotEmpty(flavors_list)
+        verify_flavor_response_extension(flavors_list[0])
 
     @decorators.idempotent_id('be6cc18c-7c5d-48c0-ac16-17eaf03c54eb')
     def test_list_non_public_flavor(self):
@@ -145,26 +141,18 @@
         flavor_name = data_utils.rand_name(self.flavor_name_prefix)
 
         # Create the flavor
-        flavor = self.create_flavor(name=flavor_name,
-                                    ram=self.ram, vcpus=self.vcpus,
-                                    disk=self.disk,
-                                    is_public="False")
-        # Verify flavor is retrieved
-        flag = False
-        flavors = self.admin_flavors_client.list_flavors(
+        self.create_flavor(name=flavor_name,
+                           ram=self.ram, vcpus=self.vcpus,
+                           disk=self.disk,
+                           is_public="False")
+        # Verify flavor is not retrieved
+        flavors_list = self.admin_flavors_client.list_flavors(
             detail=True)['flavors']
-        for flavor in flavors:
-            if flavor['name'] == flavor_name:
-                flag = True
-        self.assertFalse(flag)
+        self.assertNotIn(flavor_name, [f['name'] for f in flavors_list])
 
         # Verify flavor is not retrieved with other user
-        flag = False
-        flavors = self.flavors_client.list_flavors(detail=True)['flavors']
-        for flavor in flavors:
-            if flavor['name'] == flavor_name:
-                flag = True
-        self.assertFalse(flag)
+        flavors_list = self.flavors_client.list_flavors(detail=True)['flavors']
+        self.assertNotIn(flavor_name, [f['name'] for f in flavors_list])
 
     @decorators.idempotent_id('bcc418ef-799b-47cc-baa1-ce01368b8987')
     def test_create_server_with_non_public_flavor(self):
@@ -186,17 +174,13 @@
         flavor_name = data_utils.rand_name(self.flavor_name_prefix)
 
         # Create the flavor
-        flavor = self.create_flavor(name=flavor_name,
-                                    ram=self.ram, vcpus=self.vcpus,
-                                    disk=self.disk,
-                                    is_public="True")
-        flag = False
+        self.create_flavor(name=flavor_name,
+                           ram=self.ram, vcpus=self.vcpus,
+                           disk=self.disk,
+                           is_public="True")
         # Verify flavor is retrieved with new user
-        flavors = self.flavors_client.list_flavors(detail=True)['flavors']
-        for flavor in flavors:
-            if flavor['name'] == flavor_name:
-                flag = True
-        self.assertTrue(flag)
+        flavors_list = self.flavors_client.list_flavors(detail=True)['flavors']
+        self.assertIn(flavor_name, [f['name'] for f in flavors_list])
 
     @decorators.idempotent_id('fb9cbde6-3a0e-41f2-a983-bdb0a823c44e')
     def test_is_public_string_variations(self):
@@ -215,20 +199,13 @@
                            disk=self.disk,
                            is_public="True")
 
-        def _flavor_lookup(flavors, flavor_name):
-            for flavor in flavors:
-                if flavor['name'] == flavor_name:
-                    return flavor
-            return None
-
         def _test_string_variations(variations, flavor_name):
             for string in variations:
                 params = {'is_public': string}
                 flavors = (self.admin_flavors_client.list_flavors(detail=True,
                                                                   **params)
                            ['flavors'])
-                flavor = _flavor_lookup(flavors, flavor_name)
-                self.assertIsNotNone(flavor)
+                self.assertIn(flavor_name, [f['name'] for f in flavors])
 
         _test_string_variations(['f', 'false', 'no', '0'],
                                 flavor_name_not_public)
diff --git a/tempest/api/image/v1/test_images.py b/tempest/api/image/v1/test_images.py
index a79c18c..756c78c 100644
--- a/tempest/api/image/v1/test_images.py
+++ b/tempest/api/image/v1/test_images.py
@@ -145,24 +145,24 @@
         a_formats = ['ami', 'ari', 'aki']
 
         (cls.container_format,
-         cls.container_format_alt) = CONF.image.container_formats[:2]
+         container_format_alt) = CONF.image.container_formats[:2]
         cls.disk_format, cls.disk_format_alt = CONF.image.disk_formats[:2]
         if cls.container_format in a_formats:
             cls.disk_format = cls.container_format
-        if cls.container_format_alt in a_formats:
-            cls.disk_format_alt = cls.container_format_alt
+        if container_format_alt in a_formats:
+            cls.disk_format_alt = container_format_alt
 
         img1 = cls._create_remote_image('one', cls.container_format,
                                         cls.disk_format)
-        img2 = cls._create_remote_image('two', cls.container_format_alt,
+        img2 = cls._create_remote_image('two', container_format_alt,
                                         cls.disk_format_alt)
         img3 = cls._create_remote_image('dup', cls.container_format,
                                         cls.disk_format)
         img4 = cls._create_remote_image('dup', cls.container_format,
                                         cls.disk_format)
-        img5 = cls._create_standard_image('1', cls.container_format_alt,
+        img5 = cls._create_standard_image('1', container_format_alt,
                                           cls.disk_format_alt, 42)
-        img6 = cls._create_standard_image('2', cls.container_format_alt,
+        img6 = cls._create_standard_image('2', container_format_alt,
                                           cls.disk_format_alt, 142)
         img7 = cls._create_standard_image('33', cls.container_format,
                                           cls.disk_format, 142)
diff --git a/tempest/api/volume/test_volumes_extend.py b/tempest/api/volume/test_volumes_extend.py
index 20118df..2e1851e 100644
--- a/tempest/api/volume/test_volumes_extend.py
+++ b/tempest/api/volume/test_volumes_extend.py
@@ -23,13 +23,13 @@
     @decorators.idempotent_id('9a36df71-a257-43a5-9555-dc7c88e66e0e')
     def test_volume_extend(self):
         # Extend Volume Test.
-        self.volume = self.create_volume()
-        extend_size = int(self.volume['size']) + 1
-        self.volumes_client.extend_volume(self.volume['id'],
+        volume = self.create_volume()
+        extend_size = int(volume['size']) + 1
+        self.volumes_client.extend_volume(volume['id'],
                                           new_size=extend_size)
         waiters.wait_for_volume_status(self.volumes_client,
-                                       self.volume['id'], 'available')
-        volume = self.volumes_client.show_volume(self.volume['id'])['volume']
+                                       volume['id'], 'available')
+        volume = self.volumes_client.show_volume(volume['id'])['volume']
         self.assertEqual(int(volume['size']), extend_size)
 
 
diff --git a/tempest/config.py b/tempest/config.py
index e9b74b4..bd19967 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -648,17 +648,13 @@
                choices=['fixed', 'floating'],
                help='Default IP type used for validation: '
                     '-fixed: uses the first IP belonging to the fixed network '
-                    '-floating: creates and uses a floating IP',
-               deprecated_opts=[cfg.DeprecatedOpt('use_floatingip_for_ssh',
-                                                  group='compute')]),
+                    '-floating: creates and uses a floating IP'),
     cfg.StrOpt('auth_method',
                default='keypair',
                choices=['keypair'],
                help='Default authentication method to the instance. '
                     'Only ssh via keypair is supported for now. '
-                    'Additional methods will be handled in a separate spec.',
-               deprecated_opts=[cfg.DeprecatedOpt('ssh_auth_method',
-                                                  group='compute')]),
+                    'Additional methods will be handled in a separate spec.'),
     cfg.IntOpt('ip_version_for_ssh',
                default=4,
                help='Default IP version for ssh connections.'),
@@ -685,35 +681,25 @@
                                                   group='scenario')]),
     cfg.StrOpt('image_ssh_password',
                default="password",
-               help="Password used to authenticate to an instance.",
-               deprecated_opts=[cfg.DeprecatedOpt('image_ssh_password',
-                                                  group='compute')]),
+               help="Password used to authenticate to an instance."),
     cfg.StrOpt('ssh_shell_prologue',
                default="set -eu -o pipefail; PATH=$$PATH:/sbin;",
                help="Shell fragments to use before executing a command "
-                    "when sshing to a guest.",
-               deprecated_opts=[cfg.DeprecatedOpt('ssh_shell_prologue',
-                                                  group='compute')]),
+                    "when sshing to a guest."),
     cfg.IntOpt('ping_size',
                default=56,
                help="The packet size for ping packets originating "
-                    "from remote linux hosts",
-               deprecated_opts=[cfg.DeprecatedOpt('ping_size',
-                                                  group='compute')]),
+                    "from remote linux hosts"),
     cfg.IntOpt('ping_count',
                default=1,
                help="The number of ping packets originating from remote "
-                    "linux hosts",
-               deprecated_opts=[cfg.DeprecatedOpt('ping_count',
-                                                  group='compute')]),
+                    "linux hosts"),
     cfg.StrOpt('floating_ip_range',
                default='10.0.0.0/29',
                help='Unallocated floating IP range, which will be used to '
                     'test the floating IP bulk feature for CRUD operation. '
                     'This block must not overlap an existing floating IP '
-                    'pool.',
-               deprecated_opts=[cfg.DeprecatedOpt('floating_ip_range',
-                                                  group='compute')]),
+                    'pool.'),
     cfg.StrOpt('network_for_ssh',
                default='public',
                help="Network used for SSH connections. Ignored if "
diff --git a/tempest/scenario/test_aggregates_basic_ops.py b/tempest/scenario/test_aggregates_basic_ops.py
index 50fe9c8..95c2d32 100644
--- a/tempest/scenario/test_aggregates_basic_ops.py
+++ b/tempest/scenario/test_aggregates_basic_ops.py
@@ -36,9 +36,8 @@
     def setup_clients(cls):
         super(TestAggregatesBasicOps, cls).setup_clients()
         # Use admin client by default
-        cls.manager = cls.admin_manager
-        cls.aggregates_client = cls.manager.aggregates_client
-        cls.hosts_client = cls.manager.hosts_client
+        cls.aggregates_client = cls.admin_manager.aggregates_client
+        cls.hosts_client = cls.admin_manager.hosts_client
 
     def _create_aggregate(self, **kwargs):
         aggregate = (self.aggregates_client.create_aggregate(**kwargs)
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index e6a5f51..4dae564 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -109,13 +109,13 @@
         self.check_networks()
 
         self.ports = []
-        self.port_id = None
+        port_id = None
         if boot_with_port:
             # create a port on the network and boot with that
-            self.port_id = self._create_port(self.network['id'])['id']
-            self.ports.append({'port': self.port_id})
+            port_id = self._create_port(self.network['id'])['id']
+            self.ports.append({'port': port_id})
 
-        server = self._create_server(self.network, self.port_id)
+        server = self._create_server(self.network, port_id)
         self._check_tenant_network_connectivity()
 
         floating_ip = self.create_floating_ip(server)