Remove mistral

Additional mistral cleanup.

Change-Id: I020d1e18f64daca20226d1ccd07f16a19480761c
changes/73/809473/4
Alex Schultz 1 year ago
parent 898a960a99
commit 081922a6ba
  1. 8
      tripleoclient/config/standalone.py
  2. 1
      tripleoclient/config/undercloud.py
  3. 73
      tripleoclient/plugin.py
  4. 4
      tripleoclient/tests/config/test_config_standalone.py
  5. 2
      tripleoclient/tests/config/test_config_undercloud.py
  6. 6
      tripleoclient/tests/fakes.py
  7. 7
      tripleoclient/tests/v1/overcloud_node/test_overcloud_node.py
  8. 4
      tripleoclient/v1/undercloud_config.py

@ -52,7 +52,7 @@ NETCONFIG_TAGS_EXAMPLE = """
class StandaloneConfig(BaseConfig):
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,
telemetry=False, validations=False,
zaqar=False, neutron=False, heat=False,
@ -73,12 +73,6 @@ class StandaloneConfig(BaseConfig):
help=_('Whether to enable the ironic inspector '
'service.')
),
cfg.BoolOpt('enable_mistral',
default=mistral,
deprecated_for_removal=True,
deprecated_reason=('Support for the mistral service '
'has been deprecated.'),
help=_('Whether to enable the mistral service.')),
cfg.BoolOpt('enable_nova',
default=nova,
help=_('Whether to enable the nova service.')),

@ -76,7 +76,6 @@ class UndercloudConfig(StandaloneConfig):
heat=False,
ironic=True,
ironic_inspector=True,
mistral=False,
neutron=True,
nova=False,
novajoin=False,

@ -59,57 +59,6 @@ def build_option_parser(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):
def __init__(self, instance):
@ -117,28 +66,6 @@ class ClientWrapper(object):
self._object_store = 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):
"""Returns an local_orchestration service client"""

@ -51,7 +51,6 @@ class TestStandaloneConfig(base.TestCase):
'enable_ironic',
'enable_ironic_inspector',
'enable_keystone',
'enable_mistral',
'enable_neutron',
'enable_nova',
'enable_novajoin',
@ -75,7 +74,6 @@ class TestStandaloneConfig(base.TestCase):
keystone=True,
ironic=True,
ironic_inspector=True,
mistral=True,
neutron=True,
nova=True,
novajoin=True,
@ -89,7 +87,6 @@ class TestStandaloneConfig(base.TestCase):
'enable_ironic',
'enable_ironic_inspector',
'enable_keystone',
'enable_mistral',
'enable_neutron',
'enable_nova',
'enable_novajoin',
@ -117,7 +114,6 @@ class TestStandaloneConfig(base.TestCase):
'enable_ironic',
'enable_ironic_inspector',
'enable_keystone',
'enable_mistral',
'enable_neutron',
'enable_nova',
'enable_novajoin',

@ -100,7 +100,6 @@ class TestUndercloudConfig(base.TestCase):
'enable_ironic',
'enable_ironic_inspector',
'enable_keystone',
'enable_mistral',
'enable_neutron',
'enable_node_discovery',
'enable_nova',
@ -174,7 +173,6 @@ class TestUndercloudConfig(base.TestCase):
'enable_heat': False,
'enable_ironic': True,
'enable_ironic_inspector': True,
'enable_mistral': False,
'enable_neutron': True,
'enable_nova': False,
'enable_novajoin': False,

@ -19,8 +19,6 @@ import sys
from osc_lib.tests import utils
from tripleoclient import plugin
AUTH_TOKEN = "foobar"
AUTH_URL = "http://0.0.0.0"
WS_URL = "ws://0.0.0.0"
@ -185,7 +183,6 @@ class FakeClientManager(object):
self.auth_ref = None
self.tripleoclient = FakeClientWrapper()
self.workflow_engine = mock.Mock()
self.create_mistral_context = mock.Mock()
class FakeHandle(object):
@ -288,9 +285,6 @@ class FakePlaybookExecution(utils.TestCommand):
self.tripleoclient = mock.Mock()
stack = self.app.client_manager.orchestration = mock.Mock()
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.start()

@ -26,8 +26,6 @@ from osc_lib.tests import utils as test_utils
import yaml
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.v1 import overcloud_node
from tripleoclient.v2 import overcloud_node as overcloud_node_v2
@ -695,11 +693,6 @@ class TestDiscoverNode(fakes.TestOvercloudNode):
def setUp(self):
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.gcn = mock.patch(

@ -612,10 +612,6 @@ def prepare_undercloud_deploy(upgrade=False, no_validations=True,
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'):
LOG.warning('Novajoin has been deprecated and no longer be installed '
'using the enable_novajoin option. Please remove it from '

Loading…
Cancel
Save