Merge "Revert "verify gnocchi connection before processing""
This commit is contained in:
commit
a15c6103d7
@ -36,18 +36,6 @@ OPTS = [
|
||||
help='Dispatchers to process event data.'),
|
||||
]
|
||||
|
||||
STORAGE_OPTS = [
|
||||
cfg.IntOpt('max_retries',
|
||||
default=10,
|
||||
deprecated_group='database',
|
||||
help='Maximum number of connection retries during startup. '
|
||||
'Set to -1 to specify an infinite retry count.'),
|
||||
cfg.IntOpt('retry_interval',
|
||||
default=10,
|
||||
deprecated_group='database',
|
||||
help='Interval (in seconds) between retries of connection.'),
|
||||
]
|
||||
|
||||
|
||||
def _load_dispatcher_manager(conf, dispatcher_type):
|
||||
namespace = 'ceilometer.dispatcher.%s' % dispatcher_type
|
||||
|
@ -28,7 +28,6 @@ from oslo_utils import fnmatch
|
||||
from oslo_utils import timeutils
|
||||
import six
|
||||
from stevedore import extension
|
||||
import tenacity
|
||||
|
||||
from ceilometer import declarative
|
||||
from ceilometer import dispatcher
|
||||
@ -219,22 +218,6 @@ class GnocchiDispatcher(dispatcher.MeterDispatcherBase,
|
||||
|
||||
self._gnocchi = gnocchi_client.get_gnocchiclient(conf)
|
||||
|
||||
retries = conf.storage.max_retries
|
||||
|
||||
@tenacity.retry(
|
||||
wait=tenacity.wait_fixed(conf.storage.retry_interval),
|
||||
stop=(tenacity.stop_after_attempt(retries) if retries >= 0
|
||||
else tenacity.stop_never),
|
||||
reraise=True)
|
||||
def _get_connection():
|
||||
self._gnocchi.capabilities.list()
|
||||
|
||||
try:
|
||||
_get_connection()
|
||||
except Exception:
|
||||
LOG.error(_LE('Failed to connect to Gnocchi.'))
|
||||
raise
|
||||
|
||||
@classmethod
|
||||
def _load_resources_definitions(cls, conf):
|
||||
plugin_manager = extension.ExtensionManager(
|
||||
|
@ -120,7 +120,6 @@ def list_opts():
|
||||
ceilometer.objectstore.rgw.SERVICE_OPTS,
|
||||
ceilometer.objectstore.swift.SERVICE_OPTS,
|
||||
ceilometer.volume.discovery.SERVICE_OPTS,)),
|
||||
('storage', ceilometer.dispatcher.STORAGE_OPTS),
|
||||
('vmware', ceilometer.compute.virt.vmware.inspector.OPTS),
|
||||
('xenapi', ceilometer.compute.virt.xenapi.inspector.OPTS),
|
||||
]
|
||||
|
@ -307,7 +307,6 @@ FLOATINGIP_DELETE_END = {
|
||||
}
|
||||
|
||||
|
||||
@mock.patch('gnocchiclient.v1.client.Client', mock.Mock())
|
||||
class DispatcherTest(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
@ -652,7 +651,6 @@ class DispatcherWorkflowTest(base.BaseTestCase,
|
||||
self.useFixture(utils_fixture.TimeFixture(now))
|
||||
|
||||
expected_calls = [
|
||||
mock.call.capabilities.list(),
|
||||
mock.call.resource.search('instance_disk', search_params),
|
||||
mock.call.resource.search('instance_network_interface',
|
||||
search_params),
|
||||
@ -682,7 +680,7 @@ class DispatcherWorkflowTest(base.BaseTestCase,
|
||||
IMAGE_DELETE_START,
|
||||
VOLUME_DELETE_START,
|
||||
FLOATINGIP_DELETE_END])
|
||||
self.assertEqual(9, len(fakeclient.mock_calls))
|
||||
self.assertEqual(8, len(fakeclient.mock_calls))
|
||||
for call in expected_calls:
|
||||
self.assertIn(call, fakeclient.mock_calls)
|
||||
|
||||
@ -698,7 +696,6 @@ class DispatcherWorkflowTest(base.BaseTestCase,
|
||||
gnocchi_id = uuid.uuid4()
|
||||
|
||||
expected_calls = [
|
||||
mock.call.capabilities.list(),
|
||||
mock.call.metric.batch_resources_metrics_measures(
|
||||
{resource_id: {metric_name: self.measures_attributes}},
|
||||
create_metrics=True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user