Remove mistral
Additional mistral cleanup.
Related-Bug: #1945223
Depends-On: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/811194
Change-Id: I020d1e18f64daca20226d1ccd07f16a19480761c
(cherry picked from commit 081922a6ba
)
This commit is contained in:
parent
e97d9e7b50
commit
ff41e5dd15
@ -52,7 +52,7 @@ NETCONFIG_TAGS_EXAMPLE = """
|
|||||||
class StandaloneConfig(BaseConfig):
|
class StandaloneConfig(BaseConfig):
|
||||||
|
|
||||||
def get_enable_service_opts(self, cinder=False, frr=False, ironic=False,
|
def get_enable_service_opts(self, cinder=False, frr=False, ironic=False,
|
||||||
ironic_inspector=False, mistral=False,
|
ironic_inspector=False,
|
||||||
nova=False, novajoin=False, swift=False,
|
nova=False, novajoin=False, swift=False,
|
||||||
telemetry=False, validations=False,
|
telemetry=False, validations=False,
|
||||||
zaqar=False, neutron=False, heat=False):
|
zaqar=False, neutron=False, heat=False):
|
||||||
@ -74,9 +74,6 @@ class StandaloneConfig(BaseConfig):
|
|||||||
help=_(
|
help=_(
|
||||||
'Whether to enable the ironic inspector service.')
|
'Whether to enable the ironic inspector service.')
|
||||||
),
|
),
|
||||||
cfg.BoolOpt('enable_mistral',
|
|
||||||
default=mistral,
|
|
||||||
help=_('Whether to enable the mistral service.')),
|
|
||||||
cfg.BoolOpt('enable_nova',
|
cfg.BoolOpt('enable_nova',
|
||||||
default=nova,
|
default=nova,
|
||||||
help=_('Whether to enable the nova service.')),
|
help=_('Whether to enable the nova service.')),
|
||||||
|
@ -75,7 +75,6 @@ class UndercloudConfig(StandaloneConfig):
|
|||||||
heat=False,
|
heat=False,
|
||||||
ironic=True,
|
ironic=True,
|
||||||
ironic_inspector=True,
|
ironic_inspector=True,
|
||||||
mistral=False,
|
|
||||||
neutron=True,
|
neutron=True,
|
||||||
nova=False,
|
nova=False,
|
||||||
novajoin=False,
|
novajoin=False,
|
||||||
|
@ -59,57 +59,6 @@ def build_option_parser(parser):
|
|||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|
||||||
class MistralContext(object):
|
|
||||||
"""MistralContext, a shim for calling Mistral actions directly
|
|
||||||
|
|
||||||
The MistralContext and MistralSecurityContext combined mimic the context
|
|
||||||
which Mistral passes to actions during a Workflow execution. It does
|
|
||||||
not include all the data or cover all of the functionality but it does
|
|
||||||
include everything we use in tripleo-common.
|
|
||||||
|
|
||||||
The MistralContext should be created by the create_mistral_context method
|
|
||||||
on the ClientWrapper class below.
|
|
||||||
|
|
||||||
This should be refactored and removed once Mistral server has been removed.
|
|
||||||
"""
|
|
||||||
def __init__(self, security_ctx=None):
|
|
||||||
self.security = security_ctx
|
|
||||||
|
|
||||||
def __getattribute__(self, name):
|
|
||||||
deprecated = [
|
|
||||||
"auth_cacert", "auth_token", "auth_uri", "expires_at", "insecure",
|
|
||||||
"is_target", "is_trust_scoped", "project_id", "project_name",
|
|
||||||
"redelivered", "region_name", "service_catalog", "trust_id",
|
|
||||||
"user_name"
|
|
||||||
]
|
|
||||||
if name in deprecated:
|
|
||||||
return getattr(self.security, name)
|
|
||||||
return super(MistralContext, self).__getattribute__(name)
|
|
||||||
|
|
||||||
|
|
||||||
class MistralSecurityContext(object):
|
|
||||||
def __init__(self, auth_uri=None, auth_cacert=None, insecure=None,
|
|
||||||
service_catalog=None, region_name=None, is_trust_scoped=None,
|
|
||||||
redelivered=None, expires_at=None, trust_id=None,
|
|
||||||
is_target=None, project_id=None, project_name=None,
|
|
||||||
user_name=None, user_id=None, auth_token=None):
|
|
||||||
self.auth_uri = auth_uri
|
|
||||||
self.auth_cacert = auth_cacert
|
|
||||||
self.insecure = insecure
|
|
||||||
self.service_catalog = service_catalog
|
|
||||||
self.region_name = region_name
|
|
||||||
self.is_trust_scoped = is_trust_scoped
|
|
||||||
self.redelivered = redelivered
|
|
||||||
self.expires_at = expires_at
|
|
||||||
self.trust_id = trust_id
|
|
||||||
self.is_target = is_target
|
|
||||||
self.project_id = project_id
|
|
||||||
self.project_name = project_name
|
|
||||||
self.user_name = user_name
|
|
||||||
self.user_id = user_id
|
|
||||||
self.auth_token = auth_token
|
|
||||||
|
|
||||||
|
|
||||||
class ClientWrapper(object):
|
class ClientWrapper(object):
|
||||||
|
|
||||||
def __init__(self, instance):
|
def __init__(self, instance):
|
||||||
@ -117,28 +66,6 @@ class ClientWrapper(object):
|
|||||||
self._object_store = None
|
self._object_store = None
|
||||||
self._local_orchestration = None
|
self._local_orchestration = None
|
||||||
|
|
||||||
def create_mistral_context(self):
|
|
||||||
"""Create a Mistral context
|
|
||||||
|
|
||||||
Create a class that mimics the Mistral context. This allows us to call
|
|
||||||
Mistral action classes directly.
|
|
||||||
|
|
||||||
See the docstring on MistralContext for more context.
|
|
||||||
"""
|
|
||||||
session = self._instance.session
|
|
||||||
security_ctx = MistralSecurityContext(
|
|
||||||
auth_token=self._instance.auth.get_token(session),
|
|
||||||
auth_uri=self._instance.auth.auth_url,
|
|
||||||
project_id=self._instance.auth.get_project_id(session),
|
|
||||||
project_name=self._instance.auth._project_name,
|
|
||||||
service_catalog=session.auth.auth_ref._data['token'],
|
|
||||||
trust_id=self._instance.auth_ref.trust_id,
|
|
||||||
user_name=self._instance.auth._username,
|
|
||||||
auth_cacert=self._instance.cacert,
|
|
||||||
user_id=self._instance.auth._user_id
|
|
||||||
)
|
|
||||||
return MistralContext(security_ctx=security_ctx)
|
|
||||||
|
|
||||||
def local_orchestration(self, api_port):
|
def local_orchestration(self, api_port):
|
||||||
"""Returns an local_orchestration service client"""
|
"""Returns an local_orchestration service client"""
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# Copyright 2018 Red Hat, Inc.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
# not use this file except in compliance with the License. You may obtain
|
# not use this file except in compliance with the License. You may obtain
|
||||||
# a copy of the License at
|
# a copy of the License at
|
||||||
@ -50,7 +48,6 @@ class TestStandaloneConfig(base.TestCase):
|
|||||||
'enable_heat',
|
'enable_heat',
|
||||||
'enable_ironic',
|
'enable_ironic',
|
||||||
'enable_ironic_inspector',
|
'enable_ironic_inspector',
|
||||||
'enable_mistral',
|
|
||||||
'enable_neutron',
|
'enable_neutron',
|
||||||
'enable_nova',
|
'enable_nova',
|
||||||
'enable_novajoin',
|
'enable_novajoin',
|
||||||
@ -68,7 +65,6 @@ class TestStandaloneConfig(base.TestCase):
|
|||||||
heat=True,
|
heat=True,
|
||||||
ironic=True,
|
ironic=True,
|
||||||
ironic_inspector=True,
|
ironic_inspector=True,
|
||||||
mistral=True,
|
|
||||||
neutron=True,
|
neutron=True,
|
||||||
nova=True,
|
nova=True,
|
||||||
novajoin=True,
|
novajoin=True,
|
||||||
@ -81,7 +77,6 @@ class TestStandaloneConfig(base.TestCase):
|
|||||||
'enable_heat',
|
'enable_heat',
|
||||||
'enable_ironic',
|
'enable_ironic',
|
||||||
'enable_ironic_inspector',
|
'enable_ironic_inspector',
|
||||||
'enable_mistral',
|
|
||||||
'enable_neutron',
|
'enable_neutron',
|
||||||
'enable_nova',
|
'enable_nova',
|
||||||
'enable_novajoin',
|
'enable_novajoin',
|
||||||
@ -108,7 +103,6 @@ class TestStandaloneConfig(base.TestCase):
|
|||||||
'enable_heat',
|
'enable_heat',
|
||||||
'enable_ironic',
|
'enable_ironic',
|
||||||
'enable_ironic_inspector',
|
'enable_ironic_inspector',
|
||||||
'enable_mistral',
|
|
||||||
'enable_neutron',
|
'enable_neutron',
|
||||||
'enable_nova',
|
'enable_nova',
|
||||||
'enable_novajoin',
|
'enable_novajoin',
|
||||||
|
@ -99,7 +99,6 @@ class TestUndercloudConfig(base.TestCase):
|
|||||||
'enable_heat',
|
'enable_heat',
|
||||||
'enable_ironic',
|
'enable_ironic',
|
||||||
'enable_ironic_inspector',
|
'enable_ironic_inspector',
|
||||||
'enable_mistral',
|
|
||||||
'enable_neutron',
|
'enable_neutron',
|
||||||
'enable_node_discovery',
|
'enable_node_discovery',
|
||||||
'enable_nova',
|
'enable_nova',
|
||||||
@ -172,7 +171,6 @@ class TestUndercloudConfig(base.TestCase):
|
|||||||
'enable_heat': False,
|
'enable_heat': False,
|
||||||
'enable_ironic': True,
|
'enable_ironic': True,
|
||||||
'enable_ironic_inspector': True,
|
'enable_ironic_inspector': True,
|
||||||
'enable_mistral': False,
|
|
||||||
'enable_neutron': True,
|
'enable_neutron': True,
|
||||||
'enable_nova': False,
|
'enable_nova': False,
|
||||||
'enable_novajoin': False,
|
'enable_novajoin': False,
|
||||||
|
@ -19,8 +19,6 @@ import sys
|
|||||||
|
|
||||||
from osc_lib.tests import utils
|
from osc_lib.tests import utils
|
||||||
|
|
||||||
from tripleoclient import plugin
|
|
||||||
|
|
||||||
AUTH_TOKEN = "foobar"
|
AUTH_TOKEN = "foobar"
|
||||||
AUTH_URL = "http://0.0.0.0"
|
AUTH_URL = "http://0.0.0.0"
|
||||||
WS_URL = "ws://0.0.0.0"
|
WS_URL = "ws://0.0.0.0"
|
||||||
@ -185,7 +183,6 @@ class FakeClientManager(object):
|
|||||||
self.auth_ref = None
|
self.auth_ref = None
|
||||||
self.tripleoclient = FakeClientWrapper()
|
self.tripleoclient = FakeClientWrapper()
|
||||||
self.workflow_engine = mock.Mock()
|
self.workflow_engine = mock.Mock()
|
||||||
self.create_mistral_context = mock.Mock()
|
|
||||||
|
|
||||||
|
|
||||||
class FakeHandle(object):
|
class FakeHandle(object):
|
||||||
@ -288,9 +285,6 @@ class FakePlaybookExecution(utils.TestCommand):
|
|||||||
self.tripleoclient = mock.Mock()
|
self.tripleoclient = mock.Mock()
|
||||||
stack = self.app.client_manager.orchestration = mock.Mock()
|
stack = self.app.client_manager.orchestration = mock.Mock()
|
||||||
stack.stacks.get.return_value = FakeStackObject
|
stack.stacks.get.return_value = FakeStackObject
|
||||||
tc = self.app.client_manager.tripleoclient = FakeClientWrapper()
|
|
||||||
tc.create_mistral_context = plugin.ClientWrapper(
|
|
||||||
instance=FakeInstanceData).create_mistral_context
|
|
||||||
|
|
||||||
get_key = mock.patch('tripleoclient.utils.get_key')
|
get_key = mock.patch('tripleoclient.utils.get_key')
|
||||||
get_key.start()
|
get_key.start()
|
||||||
|
@ -26,8 +26,6 @@ from osc_lib.tests import utils as test_utils
|
|||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from tripleoclient import exceptions
|
from tripleoclient import exceptions
|
||||||
from tripleoclient import plugin
|
|
||||||
from tripleoclient.tests import fakes as ooofakes
|
|
||||||
from tripleoclient.tests.v1.overcloud_node import fakes
|
from tripleoclient.tests.v1.overcloud_node import fakes
|
||||||
from tripleoclient.v1 import overcloud_node
|
from tripleoclient.v1 import overcloud_node
|
||||||
from tripleoclient.v2 import overcloud_node as overcloud_node_v2
|
from tripleoclient.v2 import overcloud_node as overcloud_node_v2
|
||||||
@ -694,11 +692,6 @@ class TestDiscoverNode(fakes.TestOvercloudNode):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestDiscoverNode, self).setUp()
|
super(TestDiscoverNode, self).setUp()
|
||||||
|
|
||||||
client = self.app.client_manager.tripleoclient
|
|
||||||
client.create_mistral_context = plugin.ClientWrapper(
|
|
||||||
instance=ooofakes.FakeInstanceData
|
|
||||||
).create_mistral_context
|
|
||||||
|
|
||||||
self.cmd = overcloud_node.DiscoverNode(self.app, None)
|
self.cmd = overcloud_node.DiscoverNode(self.app, None)
|
||||||
|
|
||||||
self.gcn = mock.patch(
|
self.gcn = mock.patch(
|
||||||
|
@ -626,10 +626,6 @@ def prepare_undercloud_deploy(upgrade=False, no_validations=True,
|
|||||||
tht_templates, 'environments/undercloud-enable-nova.yaml')
|
tht_templates, 'environments/undercloud-enable-nova.yaml')
|
||||||
]
|
]
|
||||||
|
|
||||||
if CONF.get('enable_mistral'):
|
|
||||||
deploy_args += ['-e', os.path.join(
|
|
||||||
tht_templates, "environments/services/mistral.yaml")]
|
|
||||||
|
|
||||||
if CONF.get('enable_novajoin'):
|
if CONF.get('enable_novajoin'):
|
||||||
LOG.warning('Novajoin has been deprecated and no longer be installed '
|
LOG.warning('Novajoin has been deprecated and no longer be installed '
|
||||||
'using the enable_novajoin option. Please remove it from '
|
'using the enable_novajoin option. Please remove it from '
|
||||||
|
Loading…
Reference in New Issue
Block a user