Merge "Remove deprecated 'orchestration' config group options"
diff --git a/releasenotes/notes/removal-deprecated-config-options-3db535b979fe3509.yaml b/releasenotes/notes/removal-deprecated-config-options-3db535b979fe3509.yaml
index 0b03e21..e15d387 100644
--- a/releasenotes/notes/removal-deprecated-config-options-3db535b979fe3509.yaml
+++ b/releasenotes/notes/removal-deprecated-config-options-3db535b979fe3509.yaml
@@ -8,3 +8,5 @@
     * ``[identity-feature-enabled].forbid_global_implied_dsr``
     * ``[image-feature-enabled].deactivate_image``
     * ``[default].resources_prefix``
+    * config group ``orchestration``
+    * ``[service_available].heat``
diff --git a/tempest/cmd/account_generator.py b/tempest/cmd/account_generator.py
index 92eae02..1c671ec 100755
--- a/tempest/cmd/account_generator.py
+++ b/tempest/cmd/account_generator.py
@@ -162,9 +162,7 @@
     if CONF.service_available.swift:
         spec.append([CONF.object_storage.operator_role])
         spec.append([CONF.object_storage.reseller_admin_role])
-    if CONF.service_available.heat:
-        spec.append([CONF.orchestration.stack_owner_role,
-                     CONF.object_storage.operator_role])
+        spec.append([CONF.object_storage.operator_role])
     if admin:
         spec.append('admin')
     resources = []
diff --git a/tempest/cmd/cleanup_service.py b/tempest/cmd/cleanup_service.py
index d1e80f1..025959a 100644
--- a/tempest/cmd/cleanup_service.py
+++ b/tempest/cmd/cleanup_service.py
@@ -37,7 +37,6 @@
 
 IS_CINDER = None
 IS_GLANCE = None
-IS_HEAT = None
 IS_NEUTRON = None
 IS_NOVA = None
 
@@ -60,7 +59,6 @@
 
     IS_CINDER = CONF.service_available.cinder
     IS_GLANCE = CONF.service_available.glance
-    IS_HEAT = CONF.service_available.heat
     IS_NEUTRON = CONF.service_available.neutron
     IS_NOVA = CONF.service_available.nova
 
@@ -212,33 +210,6 @@
         self.data['server_groups'] = sgs
 
 
-class StackService(BaseService):
-    def __init__(self, manager, **kwargs):
-        super(StackService, self).__init__(kwargs)
-        params = config.service_client_config('orchestration')
-        self.client = manager.orchestration.OrchestrationClient(
-            manager.auth_provider, **params)
-
-    def list(self):
-        client = self.client
-        stacks = client.list_stacks()['stacks']
-        LOG.debug("List count, %s Stacks", len(stacks))
-        return stacks
-
-    def delete(self):
-        client = self.client
-        stacks = self.list()
-        for stack in stacks:
-            try:
-                client.delete_stack(stack['id'])
-            except Exception:
-                LOG.exception("Delete Stack exception.")
-
-    def dry_run(self):
-        stacks = self.list()
-        self.data['stacks'] = stacks
-
-
 class KeyPairService(BaseService):
     def __init__(self, manager, **kwargs):
         super(KeyPairService, self).__init__(kwargs)
@@ -960,8 +931,6 @@
         if not IS_NEUTRON:
             project_services.append(FloatingIpService)
         project_services.append(NovaQuotaService)
-    if IS_HEAT:
-        project_services.append(StackService)
     if IS_NEUTRON:
         project_services.append(NetworkFloatingIpService)
         if utils.is_extension_enabled('metering', 'network'):
diff --git a/tempest/cmd/verify_tempest_config.py b/tempest/cmd/verify_tempest_config.py
index fdf28d5..15af271 100644
--- a/tempest/cmd/verify_tempest_config.py
+++ b/tempest/cmd/verify_tempest_config.py
@@ -349,7 +349,6 @@
         'image': 'glance',
         'object_storage': 'swift',
         'compute': 'nova',
-        'orchestration': 'heat',
         'baremetal': 'ironic',
         'identity': 'keystone',
     }
diff --git a/tempest/config.py b/tempest/config.py
index bc585cb..231d005 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -65,9 +65,7 @@
                 deprecated_opts=[cfg.DeprecatedOpt('allow_tenant_isolation',
                                                    group='auth'),
                                  cfg.DeprecatedOpt('allow_tenant_isolation',
-                                                   group='compute'),
-                                 cfg.DeprecatedOpt('allow_tenant_isolation',
-                                                   group='orchestration')]),
+                                                   group='compute')]),
     cfg.ListOpt('tempest_roles',
                 help="Roles to assign to all users created by tempest",
                 default=[]),
@@ -909,66 +907,6 @@
                 help="Execute discoverability tests"),
 ]
 
-orchestration_group = cfg.OptGroup(name='orchestration',
-                                   title='Orchestration Service Options')
-
-OrchestrationGroup = [
-    cfg.StrOpt('catalog_type',
-               default='orchestration',
-               help="Catalog type of the Orchestration service.",
-               deprecated_for_removal=True,
-               deprecated_reason='Heat support will be removed from Tempest'),
-    cfg.StrOpt('region',
-               default='',
-               help="The orchestration region name to use. If empty, the "
-                    "value of identity.region is used instead. If no such "
-                    "region is found in the service catalog, the first found "
-                    "one is used.",
-               deprecated_for_removal=True,
-               deprecated_reason='Heat support will be removed from Tempest'),
-    cfg.StrOpt('endpoint_type',
-               default='publicURL',
-               choices=['public', 'admin', 'internal',
-                        'publicURL', 'adminURL', 'internalURL'],
-               help="The endpoint type to use for the orchestration service.",
-               deprecated_for_removal=True,
-               deprecated_reason='Heat support will be removed from Tempest'),
-    cfg.StrOpt('stack_owner_role', default='heat_stack_owner',
-               help='Role required for users to be able to manage stacks',
-               deprecated_for_removal=True,
-               deprecated_reason='Heat support will be removed from Tempest'),
-    cfg.IntOpt('build_interval',
-               default=1,
-               help="Time in seconds between build status checks.",
-               deprecated_for_removal=True,
-               deprecated_reason='Heat support will be removed from Tempest'),
-    cfg.IntOpt('build_timeout',
-               default=1200,
-               help="Timeout in seconds to wait for a stack to build.",
-               deprecated_for_removal=True,
-               deprecated_reason='Heat support will be removed from Tempest'),
-    cfg.StrOpt('instance_type',
-               default='m1.micro',
-               help="Instance type for tests. Needs to be big enough for a "
-                    "full OS plus the test workload",
-               deprecated_for_removal=True,
-               deprecated_reason='Heat support will be removed from Tempest'),
-    cfg.StrOpt('keypair_name',
-               help="Name of existing keypair to launch servers with.",
-               deprecated_for_removal=True,
-               deprecated_reason='Heat support will be removed from Tempest'),
-    cfg.IntOpt('max_template_size',
-               default=524288,
-               help="Value must match heat configuration of the same name.",
-               deprecated_for_removal=True,
-               deprecated_reason='Heat support will be removed from Tempest'),
-    cfg.IntOpt('max_resources_per_stack',
-               default=1000,
-               help="Value must match heat configuration of the same name.",
-               deprecated_for_removal=True,
-               deprecated_reason='Heat support will be removed from Tempest'),
-]
-
 
 scenario_group = cfg.OptGroup(name='scenario', title='Scenario Test Options')
 
@@ -1030,11 +968,6 @@
     cfg.BoolOpt('nova',
                 default=True,
                 help="Whether or not nova is expected to be available"),
-    cfg.BoolOpt('heat',
-                default=False,
-                help="Whether or not Heat is expected to be available",
-                deprecated_for_removal=True,
-                deprecated_reason='Heat support will be removed from Tempest'),
 ]
 
 debug_group = cfg.OptGroup(name="debug",
@@ -1091,7 +1024,6 @@
     (volume_feature_group, VolumeFeaturesGroup),
     (object_storage_group, ObjectStoreGroup),
     (object_storage_feature_group, ObjectStoreFeaturesGroup),
-    (orchestration_group, OrchestrationGroup),
     (scenario_group, ScenarioGroup),
     (service_available_group, ServiceAvailableGroup),
     (debug_group, DebugGroup),
@@ -1158,7 +1090,6 @@
         self.object_storage = _CONF['object-storage']
         self.object_storage_feature_enabled = _CONF[
             'object-storage-feature-enabled']
-        self.orchestration = _CONF.orchestration
         self.scenario = _CONF.scenario
         self.service_available = _CONF.service_available
         self.debug = _CONF.debug
diff --git a/tempest/tests/cmd/test_account_generator.py b/tempest/tests/cmd/test_account_generator.py
index 8bf4c5b..fd9af08 100644
--- a/tempest/tests/cmd/test_account_generator.py
+++ b/tempest/tests/cmd/test_account_generator.py
@@ -153,17 +153,14 @@
 
     def test_generate_resources_no_admin(self):
         cfg.CONF.set_default('swift', False, group='service_available')
-        cfg.CONF.set_default('heat', False, group='service_available')
         cfg.CONF.set_default('operator_role', 'fake_operator',
                              group='object-storage')
         cfg.CONF.set_default('reseller_admin_role', 'fake_reseller',
                              group='object-storage')
-        cfg.CONF.set_default('stack_owner_role', 'fake_owner',
-                             group='orchestration')
         resources = account_generator.generate_resources(
             self.cred_provider, admin=False)
         resource_types = [k for k, _ in resources]
-        # No admin, no heat, no swift, expect two credentials only
+        # No admin, no swift, expect two credentials only
         self.assertEqual(2, len(resources))
         # Ensure create_user was invoked twice (two distinct users)
         self.assertEqual(2, self.user_create_fixture.mock.call_count)
@@ -180,17 +177,14 @@
 
     def test_generate_resources_admin(self):
         cfg.CONF.set_default('swift', False, group='service_available')
-        cfg.CONF.set_default('heat', False, group='service_available')
         cfg.CONF.set_default('operator_role', 'fake_operator',
                              group='object-storage')
         cfg.CONF.set_default('reseller_admin_role', 'fake_reseller',
                              group='object-storage')
-        cfg.CONF.set_default('stack_owner_role', 'fake_owner',
-                             group='orchestration')
         resources = account_generator.generate_resources(
             self.cred_provider, admin=True)
         resource_types = [k for k, _ in resources]
-        # Admin, no heat, no swift, expect three credentials only
+        # Admin, no swift, expect three credentials only
         self.assertEqual(3, len(resources))
         # Ensure create_user was invoked 3 times (3 distinct users)
         self.assertEqual(3, self.user_create_fixture.mock.call_count)
@@ -205,28 +199,24 @@
             self.assertIsNotNone(resource[1].router)
             self.assertIsNotNone(resource[1].subnet)
 
-    def test_generate_resources_swift_heat_admin(self):
+    def test_generate_resources_swift_admin(self):
         cfg.CONF.set_default('swift', True, group='service_available')
-        cfg.CONF.set_default('heat', True, group='service_available')
         cfg.CONF.set_default('operator_role', 'fake_operator',
                              group='object-storage')
         cfg.CONF.set_default('reseller_admin_role', 'fake_reseller',
                              group='object-storage')
-        cfg.CONF.set_default('stack_owner_role', 'fake_owner',
-                             group='orchestration')
         resources = account_generator.generate_resources(
             self.cred_provider, admin=True)
         resource_types = [k for k, _ in resources]
         # all options on, expect six credentials
         self.assertEqual(6, len(resources))
         # Ensure create_user was invoked 6 times (6 distinct users)
-        self.assertEqual(6, self.user_create_fixture.mock.call_count)
+        self.assertEqual(5, self.user_create_fixture.mock.call_count)
         self.assertIn('primary', resource_types)
         self.assertIn('alt', resource_types)
         self.assertIn('admin', resource_types)
         self.assertIn(['fake_operator'], resource_types)
         self.assertIn(['fake_reseller'], resource_types)
-        self.assertIn(['fake_owner', 'fake_operator'], resource_types)
         for resource in resources:
             self.assertIsNotNone(resource[1].network)
             self.assertIsNotNone(resource[1].router)
@@ -258,7 +248,6 @@
             self.opts)
         self.mock_resource_creation()
         cfg.CONF.set_default('swift', True, group='service_available')
-        cfg.CONF.set_default('heat', True, group='service_available')
         self.resources = account_generator.generate_resources(
             self.cred_provider, admin=True)
 
diff --git a/tempest/tests/fake_config.py b/tempest/tests/fake_config.py
index f1d3bba..4a2fff4 100644
--- a/tempest/tests/fake_config.py
+++ b/tempest/tests/fake_config.py
@@ -39,7 +39,6 @@
         self.conf.set_default('uri_v3', 'http://fake_uri_v3.com/auth',
                               group='identity')
         self.conf.set_default('neutron', True, group='service_available')
-        self.conf.set_default('heat', True, group='service_available')
         lock_path = str(os.environ.get('OS_TEST_LOCK_PATH',
                                        os.environ.get('TMPDIR', '/tmp')))
         if not os.path.exists(lock_path):