Merge "Remove ceilometer actions from mistral"
This commit is contained in:
commit
70d8eb427d
@ -18,7 +18,7 @@ from mistral.actions.openstack.action_generator import base
|
||||
|
||||
|
||||
SUPPORTED_MODULES = [
|
||||
'Nova', 'Glance', 'Keystone', 'Heat', 'Neutron', 'Cinder', 'Ceilometer',
|
||||
'Nova', 'Glance', 'Keystone', 'Heat', 'Neutron', 'Cinder',
|
||||
'Trove', 'Ironic', 'Baremetal Introspection', 'Swift', 'Zaqar', 'Barbican',
|
||||
'Mistral', 'Designate', 'Magnum', 'Murano', 'Tacker', 'Aodh', 'Gnocchi',
|
||||
'Glare'
|
||||
|
@ -51,7 +51,6 @@ def _try_import(module_name):
|
||||
|
||||
aodhclient = _try_import('aodhclient.v2.client')
|
||||
barbicanclient = _try_import('barbicanclient.client')
|
||||
ceilometerclient = _try_import('ceilometerclient.v2.client')
|
||||
cinderclient = _try_import('cinderclient.client')
|
||||
designateclient = _try_import('designateclient.v1')
|
||||
glanceclient = _try_import('glanceclient')
|
||||
@ -159,37 +158,6 @@ class KeystoneAction(base.OpenStackAction):
|
||||
return fake_client
|
||||
|
||||
|
||||
class CeilometerAction(base.OpenStackAction):
|
||||
_service_type = 'metering'
|
||||
|
||||
@classmethod
|
||||
def _get_client_class(cls):
|
||||
return ceilometerclient.Client
|
||||
|
||||
def _create_client(self, context):
|
||||
|
||||
LOG.debug("Ceilometer action security context: %s", context)
|
||||
|
||||
ceilometer_endpoint = self.get_service_endpoint()
|
||||
|
||||
endpoint_url = keystone_utils.format_url(
|
||||
ceilometer_endpoint.url,
|
||||
{'tenant_id': context.project_id}
|
||||
)
|
||||
|
||||
return self._get_client_class()(
|
||||
endpoint_url,
|
||||
region_name=ceilometer_endpoint.region,
|
||||
token=context.auth_token,
|
||||
username=context.user_name,
|
||||
insecure=context.insecure
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def _get_fake_client(cls):
|
||||
return cls._get_client_class()("")
|
||||
|
||||
|
||||
class HeatAction(base.OpenStackAction):
|
||||
_service_type = 'orchestration'
|
||||
|
||||
|
@ -484,35 +484,6 @@
|
||||
"template_versions_get": "template_versions.get",
|
||||
"template_versions_list": "template_versions.list"
|
||||
},
|
||||
"ceilometer": {
|
||||
"_comment": "It uses ceilometerclient.v2.",
|
||||
"alarms_create": "alarms.create",
|
||||
"alarms_delete": "alarms.delete",
|
||||
"alarms_get": "alarms.get",
|
||||
"alarms_get_history": "alarms.get_history",
|
||||
"alarms_get_state": "alarms.get_state",
|
||||
"alarms_list": "alarms.list",
|
||||
"alarms_set_state": "alarms.set_state",
|
||||
"alarms_update": "alarms.update",
|
||||
"capabilities_get": "capabilities.get",
|
||||
"event_types_list": "event_types.list",
|
||||
"events_get": "events.get",
|
||||
"events_list": "events.list",
|
||||
"meters_list": "meters.list",
|
||||
"new_samples_get": "new_samples.get",
|
||||
"new_samples_list": "new_samples.list",
|
||||
"query_alarm_history_query": "query_alarm_history.query",
|
||||
"query_alarms_query": "query_alarms.query",
|
||||
"query_samples_query": "query_samples.query",
|
||||
"resources_get": "resources.get",
|
||||
"resources_list": "resources.list",
|
||||
"samples_create": "samples.create",
|
||||
"samples_create_list": "samples.create_list",
|
||||
"samples_list": "samples.list",
|
||||
"statistics_list": "statistics.list",
|
||||
"trait_descriptions_list": "trait_descriptions.list",
|
||||
"traits_list": "traits.list"
|
||||
},
|
||||
"aodh": {
|
||||
"_comment": "It uses aodhclient.v2.",
|
||||
"capabilities_list": "capabilities.list",
|
||||
|
@ -363,7 +363,7 @@ openstack_actions_opts = [
|
||||
),
|
||||
cfg.ListOpt(
|
||||
'modules-support-region',
|
||||
default=['nova', 'glance', 'ceilometer', 'heat', 'neutron', 'cinder',
|
||||
default=['nova', 'glance', 'heat', 'neutron', 'cinder',
|
||||
'trove', 'ironic', 'designate', 'murano', 'tacker', 'senlin',
|
||||
'aodh', 'gnocchi'],
|
||||
help=_('List of module names that support region in actions.')
|
||||
|
@ -38,7 +38,6 @@ MODULE_MAPPING = {
|
||||
'heat': ['heat.stacks_list', actions.HeatAction],
|
||||
'neutron': ['neutron.show_network', actions.NeutronAction],
|
||||
'cinder': ['cinder.volumes_list', actions.CinderAction],
|
||||
'ceilometer': ['ceilometer.alarms_list', actions.CeilometerAction],
|
||||
'trove': ['trove.instances_list', actions.TroveAction],
|
||||
'ironic': ['ironic.node_list', actions.IronicAction],
|
||||
'baremetal_introspection': ['baremetal_introspection.introspect',
|
||||
|
@ -109,19 +109,6 @@ class OpenStackActionTest(base.BaseTestCase):
|
||||
self.assertTrue(mocked().volumes.get.called)
|
||||
mocked().volumes.get.assert_called_once_with(volume="1234-abcd")
|
||||
|
||||
@mock.patch.object(actions.CeilometerAction, '_get_client')
|
||||
def test_ceilometer_action(self, mocked):
|
||||
mock_ctx = mock.Mock()
|
||||
method_name = "alarms.get"
|
||||
action_class = actions.CeilometerAction
|
||||
action_class.client_method_name = method_name
|
||||
params = {'alarm_id': '1234-abcd'}
|
||||
action = action_class(**params)
|
||||
action.run(mock_ctx)
|
||||
|
||||
self.assertTrue(mocked().alarms.get.called)
|
||||
mocked().alarms.get.assert_called_once_with(alarm_id="1234-abcd")
|
||||
|
||||
@mock.patch.object(actions.TroveAction, '_get_client')
|
||||
def test_trove_action(self, mocked):
|
||||
mock_ctx = mock.Mock()
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Remove ceilometerclient requirement. This library is not maintained
|
||||
and the ceilometer api is dead. So lets drop this integration.
|
@ -31,7 +31,6 @@ paramiko>=2.0.0 # LGPLv2.1+
|
||||
pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
||||
pecan!=1.0.2,!=1.0.3,!=1.0.4,!=1.2,>=1.0.0 # BSD
|
||||
python-barbicanclient!=4.5.0,!=4.5.1,>=4.0.0 # Apache-2.0
|
||||
python-ceilometerclient>=2.5.0 # Apache-2.0
|
||||
python-cinderclient>=3.3.0 # Apache-2.0
|
||||
python-designateclient>=2.7.0 # Apache-2.0
|
||||
python-glanceclient>=2.8.0 # Apache-2.0
|
||||
|
@ -22,7 +22,6 @@ from aodhclient.v2 import base as aodh_base
|
||||
from aodhclient.v2 import client as aodhclient
|
||||
from barbicanclient import base as barbican_base
|
||||
from barbicanclient import client as barbicanclient
|
||||
from ceilometerclient.v2 import client as ceilometerclient
|
||||
from cinderclient.apiclient import base as cinder_base
|
||||
from cinderclient.v2 import client as cinderclient
|
||||
from designateclient import client as designateclient
|
||||
@ -139,11 +138,6 @@ GLANCE_NAMESPACE_LIST = [
|
||||
'metadefs_tag', 'metadefs_namespace', 'versions'
|
||||
]
|
||||
|
||||
CEILOMETER_NAMESPACE_LIST = [
|
||||
'alarms', 'capabilities', 'event_types', 'events', 'meters',
|
||||
'new_samples', 'query_alarm_history', 'query_alarms', 'query_samples',
|
||||
'resources', 'samples', 'statistics', 'trait_descriptions', 'traits'
|
||||
]
|
||||
|
||||
DESIGNATE_NAMESPACE_LIST = [
|
||||
'diagnostics', 'domains', 'quotas', 'records', 'reports', 'servers',
|
||||
@ -170,10 +164,6 @@ def get_heat_client(**kwargs):
|
||||
return heatclient.Client('')
|
||||
|
||||
|
||||
def get_ceilometer_client(**kwargs):
|
||||
return ceilometerclient.Client('')
|
||||
|
||||
|
||||
def get_cinder_client(**kwargs):
|
||||
return cinderclient.Client()
|
||||
|
||||
@ -224,7 +214,6 @@ def get_glare_client(**kwargs):
|
||||
CLIENTS = {
|
||||
'nova': get_nova_client,
|
||||
'heat': get_heat_client,
|
||||
'ceilometer': get_ceilometer_client,
|
||||
'cinder': get_cinder_client,
|
||||
'keystone': get_keystone_client,
|
||||
'glance': get_glance_client,
|
||||
@ -246,7 +235,6 @@ CLIENTS = {
|
||||
BASE_MANAGERS = {
|
||||
'nova': BASE_NOVA_MANAGER,
|
||||
'heat': BASE_HEAT_MANAGER,
|
||||
'ceilometer': None,
|
||||
'cinder': BASE_CINDER_MANAGER,
|
||||
'keystone': BASE_KEYSTONE_MANAGER,
|
||||
'glance': None,
|
||||
@ -267,7 +255,6 @@ BASE_MANAGERS = {
|
||||
}
|
||||
NAMESPACES = {
|
||||
'glance': GLANCE_NAMESPACE_LIST,
|
||||
'ceilometer': CEILOMETER_NAMESPACE_LIST,
|
||||
'designate': DESIGNATE_NAMESPACE_LIST,
|
||||
'glare': GLARE_NAMESPACE_LIST
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user