Rename module collectd_ceilometer->collectd_openstack
Rename the module to fit with the repo rename Change-Id: I8f3c5a3d1f481a82d742b0b00a52a6d78d76630d
This commit is contained in:
parent
f58efd0311
commit
b5cb3b4158
@ -16,7 +16,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from collectd_ceilometer.aodh import sender as aodh_sender
|
||||
from collectd_openstack.aodh import sender as aodh_sender
|
||||
|
||||
import datetime
|
||||
import logging
|
@ -23,15 +23,15 @@ try:
|
||||
except ImportError:
|
||||
collectd = None # when running unit tests collectd is not avaliable
|
||||
|
||||
import collectd_ceilometer
|
||||
from collectd_ceilometer.aodh.notifier import Notifier
|
||||
from collectd_ceilometer.common.logger import CollectdLogHandler
|
||||
from collectd_ceilometer.common.meters import MeterStorage
|
||||
from collectd_ceilometer.common.settings import Config
|
||||
import collectd_openstack
|
||||
from collectd_openstack.aodh.notifier import Notifier
|
||||
from collectd_openstack.common.logger import CollectdLogHandler
|
||||
from collectd_openstack.common.meters import MeterStorage
|
||||
from collectd_openstack.common.settings import Config
|
||||
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
ROOT_LOGGER = logging.getLogger(collectd_ceilometer.__name__)
|
||||
ROOT_LOGGER = logging.getLogger(collectd_openstack.__name__)
|
||||
|
||||
|
||||
def register_plugin(collectd):
|
@ -22,13 +22,13 @@ import logging
|
||||
import requests
|
||||
|
||||
|
||||
import collectd_ceilometer
|
||||
from collectd_ceilometer.common import sender as common_sender
|
||||
from collectd_ceilometer.common.settings import Config
|
||||
import collectd_openstack
|
||||
from collectd_openstack.common import sender as common_sender
|
||||
from collectd_openstack.common.settings import Config
|
||||
from collections import OrderedDict
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
ROOT_LOGGER = logging.getLogger(collectd_ceilometer.__name__)
|
||||
ROOT_LOGGER = logging.getLogger(collectd_openstack.__name__)
|
||||
|
||||
# HTTP status codes
|
||||
HTTP_CREATED = 201
|
@ -15,4 +15,4 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from collectd_ceilometer.common.meters.storage import MeterStorage # noqa
|
||||
from collectd_openstack.common.meters.storage import MeterStorage # noqa
|
@ -16,7 +16,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from collectd_ceilometer.common.settings import Config
|
||||
from collectd_openstack.common.settings import Config
|
||||
import logging
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
@ -15,8 +15,8 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from collectd_ceilometer.common.meters.base import Meter
|
||||
from collectd_ceilometer.common.settings import Config
|
||||
from collectd_openstack.common.meters.base import Meter
|
||||
from collectd_openstack.common.settings import Config
|
||||
import libvirt
|
||||
import threading
|
||||
|
@ -19,9 +19,9 @@ from collections import defaultdict
|
||||
import six
|
||||
import threading
|
||||
|
||||
from collectd_ceilometer.common.meters.base import Meter
|
||||
from collectd_ceilometer.common.meters.libvirt import LibvirtMeter
|
||||
from collectd_ceilometer.common.settings import Config
|
||||
from collectd_openstack.common.meters.base import Meter
|
||||
from collectd_openstack.common.meters.libvirt import LibvirtMeter
|
||||
from collectd_openstack.common.settings import Config
|
||||
|
||||
|
||||
class MeterStorage(object):
|
@ -23,9 +23,9 @@ import requests
|
||||
import six
|
||||
import time
|
||||
|
||||
from collectd_ceilometer.common.keystone_light import ClientV3
|
||||
from collectd_ceilometer.common.keystone_light import KeystoneException
|
||||
from collectd_ceilometer.common.settings import Config
|
||||
from collectd_openstack.common.keystone_light import ClientV3
|
||||
from collectd_openstack.common.keystone_light import KeystoneException
|
||||
from collectd_openstack.common.settings import Config
|
||||
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
@ -15,8 +15,8 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from collectd_ceilometer.common.singleton import Singleton
|
||||
from collectd_ceilometer.common.units import UNITS
|
||||
from collectd_openstack.common.singleton import Singleton
|
||||
from collectd_openstack.common.units import UNITS
|
||||
from collections import namedtuple
|
||||
import logging
|
||||
import six
|
@ -22,14 +22,14 @@ try:
|
||||
except ImportError:
|
||||
collectd = None # when running unit tests collectd is not avaliable
|
||||
|
||||
import collectd_ceilometer
|
||||
from collectd_ceilometer.common.logger import CollectdLogHandler
|
||||
from collectd_ceilometer.common.meters import MeterStorage
|
||||
from collectd_ceilometer.common.settings import Config
|
||||
from collectd_ceilometer.gnocchi.writer import Writer
|
||||
import collectd_openstack
|
||||
from collectd_openstack.common.logger import CollectdLogHandler
|
||||
from collectd_openstack.common.meters import MeterStorage
|
||||
from collectd_openstack.common.settings import Config
|
||||
from collectd_openstack.gnocchi.writer import Writer
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
ROOT_LOGGER = logging.getLogger(collectd_ceilometer.__name__)
|
||||
ROOT_LOGGER = logging.getLogger(collectd_openstack.__name__)
|
||||
|
||||
|
||||
def register_plugin(collectd):
|
@ -16,15 +16,15 @@
|
||||
from __future__ import division
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import collectd_ceilometer
|
||||
from collectd_ceilometer.common import sender as common_sender
|
||||
from collectd_ceilometer.common.settings import Config
|
||||
import collectd_openstack
|
||||
from collectd_openstack.common import sender as common_sender
|
||||
from collectd_openstack.common.settings import Config
|
||||
|
||||
import json
|
||||
import logging
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
ROOT_LOGGER = logging.getLogger(collectd_ceilometer.__name__)
|
||||
ROOT_LOGGER = logging.getLogger(collectd_openstack.__name__)
|
||||
|
||||
|
||||
class Sender(common_sender.Sender):
|
@ -15,8 +15,8 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from collectd_ceilometer.common.meters.storage import SampleContainer
|
||||
from collectd_ceilometer.gnocchi import sender as gnocchi_sender
|
||||
from collectd_openstack.common.meters.storage import SampleContainer
|
||||
from collectd_openstack.gnocchi import sender as gnocchi_sender
|
||||
from collections import namedtuple
|
||||
import datetime
|
||||
import json
|
@ -24,11 +24,11 @@ import requests
|
||||
import six
|
||||
import unittest
|
||||
|
||||
from collectd_ceilometer.aodh import plugin
|
||||
from collectd_ceilometer.aodh import sender as aodh_sender
|
||||
from collectd_ceilometer.common.keystone_light import KeystoneException
|
||||
from collectd_ceilometer.common import sender as common_sender
|
||||
from collectd_ceilometer.common import settings
|
||||
from collectd_openstack.aodh import plugin
|
||||
from collectd_openstack.aodh import sender as aodh_sender
|
||||
from collectd_openstack.common.keystone_light import KeystoneException
|
||||
from collectd_openstack.common import sender as common_sender
|
||||
from collectd_openstack.common import settings
|
||||
|
||||
Logger = logging.getLoggerClass()
|
||||
|
||||
@ -84,7 +84,7 @@ def mock_config(**kwargs):
|
||||
|
||||
def config_module(
|
||||
values, severities=None,
|
||||
module_name="collectd_ceilometer.ceilometer.plugin"):
|
||||
module_name="collectd_openstack.aodh.plugin"):
|
||||
children = [config_value(key, value)
|
||||
for key, value in six.iteritems(values)]
|
||||
if severities:
|
@ -21,10 +21,10 @@ import mock
|
||||
import requests
|
||||
import unittest
|
||||
|
||||
from collectd_ceilometer.aodh import sender as aodh_sender
|
||||
from collectd_openstack.aodh import sender as aodh_sender
|
||||
from collections import OrderedDict
|
||||
|
||||
from collectd_ceilometer.common.meters import base
|
||||
from collectd_openstack.common.meters import base
|
||||
|
||||
valid_resp = '[{"alarm_actions": [], "event_rule": {"query": [],'\
|
||||
'"event_type": "events.gauge"}, "ok_actions": [],'\
|
@ -22,7 +22,7 @@ from unittest import TestCase
|
||||
import mock
|
||||
import six
|
||||
|
||||
from collectd_ceilometer.common import settings
|
||||
from collectd_openstack.common import settings
|
||||
|
||||
|
||||
def config_module(
|
@ -18,9 +18,9 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from collectd_ceilometer.common import keystone_light
|
||||
from collectd_ceilometer.common.keystone_light import ClientV3
|
||||
from collectd_ceilometer.common.keystone_light import MissingServices
|
||||
from collectd_openstack.common import keystone_light
|
||||
from collectd_openstack.common.keystone_light import ClientV3
|
||||
from collectd_openstack.common.keystone_light import MissingServices
|
||||
import mock
|
||||
import unittest
|
||||
|
||||
@ -99,7 +99,7 @@ class KeystoneLightTestV3(unittest.TestCase):
|
||||
'X-Subject-Token': "c5bbb1c9a27e470fb482de2a718e08c2"
|
||||
}
|
||||
|
||||
@mock.patch('collectd_ceilometer.common.keystone_light.requests.post')
|
||||
@mock.patch('collectd_openstack.common.keystone_light.requests.post')
|
||||
def test_refresh(self, mock_post):
|
||||
"""Test refresh"""
|
||||
|
||||
@ -140,8 +140,8 @@ class KeystoneLightTestV3(unittest.TestCase):
|
||||
headers=expected_args['headers'],
|
||||
)
|
||||
|
||||
@mock.patch('collectd_ceilometer.common.keystone_light.requests.post')
|
||||
def test_get_service_endpoint(self, mock_post):
|
||||
@mock.patch('collectd_openstack.common.keystone_light.requests.post')
|
||||
def test_getservice_endpoint(self, mock_post):
|
||||
"""Test get_service_endpoint"""
|
||||
|
||||
mock_post.return_value = self.mock_response
|
||||
@ -163,8 +163,8 @@ class KeystoneLightTestV3(unittest.TestCase):
|
||||
with self.assertRaises(MissingServices):
|
||||
client.get_service_endpoint('badname')
|
||||
|
||||
@mock.patch('collectd_ceilometer.common.keystone_light.requests.post')
|
||||
def test_get_service_endpoint_error(self, mock_post):
|
||||
@mock.patch('collectd_openstack.common.keystone_light.requests.post')
|
||||
def test_getservice_endpoint_error(self, mock_post):
|
||||
"""Test get service endpoint error"""
|
||||
|
||||
response = {"token": {
|
||||
@ -216,7 +216,7 @@ class KeystoneLightTestV3(unittest.TestCase):
|
||||
with self.assertRaises(MissingServices):
|
||||
client.get_service_endpoint('gnocchi')
|
||||
|
||||
@mock.patch('collectd_ceilometer.common.keystone_light.requests.post')
|
||||
@mock.patch('collectd_openstack.common.keystone_light.requests.post')
|
||||
def test_invalidresponse_missing_token(self, mock_post):
|
||||
"""Test invalid response: missing access"""
|
||||
|
||||
@ -235,7 +235,7 @@ class KeystoneLightTestV3(unittest.TestCase):
|
||||
with self.assertRaises(keystone_light.InvalidResponse):
|
||||
client.refresh()
|
||||
|
||||
@mock.patch('collectd_ceilometer.common.keystone_light.requests.post')
|
||||
@mock.patch('collectd_openstack.common.keystone_light.requests.post')
|
||||
def test_invalidresponse_missing_catalog(self, mock_post):
|
||||
"""Test invalid response: missing catalog"""
|
||||
|
||||
@ -279,7 +279,7 @@ class KeystoneLightTestV3(unittest.TestCase):
|
||||
with self.assertRaises(keystone_light.InvalidResponse):
|
||||
client.refresh()
|
||||
|
||||
@mock.patch('collectd_ceilometer.common.keystone_light.requests.post')
|
||||
@mock.patch('collectd_openstack.common.keystone_light.requests.post')
|
||||
def test_invalid_response_missing_token_http_header(self, mock_post):
|
||||
"""Test invalid response: missing token in header"""
|
||||
|
@ -16,9 +16,9 @@ import unittest
|
||||
|
||||
import mock
|
||||
|
||||
from collectd_ceilometer.common.logger import CollectdLogHandler
|
||||
from collectd_ceilometer.common.settings import Config
|
||||
from collectd_ceilometer.tests.mocking import patch_class
|
||||
from collectd_openstack.common.logger import CollectdLogHandler
|
||||
from collectd_openstack.common.settings import Config
|
||||
from collectd_openstack.tests.mocking import patch_class
|
||||
|
||||
|
||||
class MockedCollectd(object):
|
@ -19,8 +19,8 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from collectd_ceilometer.common.meters.base import Meter
|
||||
from collectd_ceilometer.tests.base import TestCase
|
||||
from collectd_openstack.common.meters.base import Meter
|
||||
from collectd_openstack.tests.base import TestCase
|
||||
|
||||
import mock
|
||||
|
||||
@ -38,7 +38,7 @@ class CollectdMock(object):
|
||||
pass
|
||||
|
||||
collectd_class = \
|
||||
'collectd_ceilometer.tests.common.test_meters_base.CollectdMock'
|
||||
'collectd_openstack.tests.common.test_meters_base.CollectdMock'
|
||||
|
||||
|
||||
class MetersTest(TestCase):
|
||||
@ -88,7 +88,7 @@ class MetersTest(TestCase):
|
||||
self._collectd.get_dataset.assert_called_once()
|
||||
self.assertEqual("cumulative", actual)
|
||||
|
||||
@mock.patch('collectd_ceilometer.common.meters.base.LOGGER')
|
||||
@mock.patch('collectd_openstack.common.meters.base.LOGGER')
|
||||
def test_sample_type_invalid(self, LOGGER):
|
||||
self._collectd.get_dataset.side_effect = Exception("Boom!")
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from collectd_ceilometer.common.meters.storage import SampleContainer
|
||||
from collectd_openstack.common.meters.storage import SampleContainer
|
||||
|
||||
import unittest
|
||||
|
@ -21,7 +21,7 @@ import mock
|
||||
import requests
|
||||
import unittest
|
||||
|
||||
from collectd_ceilometer.common import sender as common_sender
|
||||
from collectd_openstack.common import sender as common_sender
|
||||
|
||||
|
||||
class TestSender(unittest.TestCase):
|
@ -22,12 +22,12 @@ import mock
|
||||
import requests
|
||||
import unittest
|
||||
|
||||
from collectd_ceilometer.common.keystone_light import KeystoneException
|
||||
from collectd_ceilometer.common import sender as common_sender
|
||||
from collectd_ceilometer.gnocchi import plugin
|
||||
from collectd_ceilometer.gnocchi import sender as gnocchi_sender
|
||||
from collectd_openstack.common.keystone_light import KeystoneException
|
||||
from collectd_openstack.common import sender as common_sender
|
||||
from collectd_openstack.gnocchi import plugin
|
||||
from collectd_openstack.gnocchi import sender as gnocchi_sender
|
||||
|
||||
from collectd_ceilometer.tests import match
|
||||
from collectd_openstack.tests import match
|
||||
|
||||
Logger = logging.getLoggerClass()
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
import unittest
|
||||
|
||||
from collectd_ceilometer.gnocchi import sender as gnocchi_sender
|
||||
from collectd_openstack.gnocchi import sender as gnocchi_sender
|
||||
|
||||
|
||||
class TestGnocchiSender(unittest.TestCase):
|
@ -19,8 +19,8 @@
|
||||
import mock
|
||||
import unittest
|
||||
|
||||
from collectd_ceilometer.common.meters import MeterStorage
|
||||
from collectd_ceilometer.gnocchi import writer
|
||||
from collectd_openstack.common.meters import MeterStorage
|
||||
from collectd_openstack.gnocchi import writer
|
||||
|
||||
|
||||
def mock_collectd(**kwargs):
|
@ -15,14 +15,14 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
"""Test cases for collectd_ceilometer.meters.base module."""
|
||||
"""Test cases for collectd_openstack.meters.base module."""
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
import mock
|
||||
|
||||
from collectd_ceilometer.common.meters.base import Meter
|
||||
from collectd_ceilometer.tests.mocking import patch_class
|
||||
from collectd_openstack.common.meters.base import Meter
|
||||
from collectd_openstack.tests.mocking import patch_class
|
||||
|
||||
|
||||
class Values(object):
|
||||
@ -88,7 +88,7 @@ class MetersTest(TestCase):
|
||||
collectd.get_dataset.assert_called_once()
|
||||
self.assertEqual("cumulative", actual)
|
||||
|
||||
@mock.patch('collectd_ceilometer.common.meters.base.LOGGER')
|
||||
@mock.patch('collectd_openstack.common.meters.base.LOGGER')
|
||||
@patch_collectd
|
||||
def test_sample_type_invalid(self, collectd, LOGGER):
|
||||
collectd.get_dataset.side_effect = Exception("Boom!")
|
@ -3,12 +3,12 @@
|
||||
</LoadPlugin>
|
||||
|
||||
<Plugin python>
|
||||
ModulePath "/opt/stack/collectd-ceilometer"
|
||||
ModulePath "/opt/stack/collectd-ceilometer-plugin"
|
||||
LogTraces true
|
||||
Interactive false
|
||||
Import "collectd_ceilometer.aodh.plugin"
|
||||
Import "collectd_openstack.aodh.plugin"
|
||||
|
||||
<Module "collectd_ceilometer.aodh.plugin">
|
||||
<Module "collectd_openstack.aodh.plugin">
|
||||
|
||||
# Verbosity True|False
|
||||
VERBOSE False
|
||||
|
@ -6,9 +6,9 @@
|
||||
ModulePath "/opt/stack/collectd-ceilometer-plugin"
|
||||
LogTraces true
|
||||
Interactive false
|
||||
Import "collectd_ceilometer.gnocchi.plugin"
|
||||
Import "collectd_openstack.gnocchi.plugin"
|
||||
|
||||
<Module "collectd_ceilometer.gnocchi.plugin">
|
||||
<Module "collectd_openstack.gnocchi.plugin">
|
||||
|
||||
# Verbosity True|False
|
||||
VERBOSE False
|
||||
|
18
setup.cfg
18
setup.cfg
@ -1,6 +1,6 @@
|
||||
[metadata]
|
||||
name = collectd-ceilometer-plugin
|
||||
summary = OpenStack Ceilometer plugin for collectd.
|
||||
summary = A collection of OpenStack plugins for collectd.
|
||||
description-file =
|
||||
README.rst
|
||||
author = OpenStack
|
||||
@ -19,11 +19,11 @@ classifier =
|
||||
Programming Language :: Python :: 3.5
|
||||
|
||||
[test]
|
||||
test_suite=collectd_ceilometer.tests
|
||||
test_suite=collectd_openstack.tests
|
||||
|
||||
[files]
|
||||
packages =
|
||||
collectd_ceilometer
|
||||
collectd_openstack
|
||||
collectd_gnocchi
|
||||
|
||||
[build_sphinx]
|
||||
@ -35,18 +35,18 @@ all_files = 1
|
||||
upload-dir = doc/build/html
|
||||
|
||||
[compile_catalog]
|
||||
directory = collectd_ceilometer/locale
|
||||
domain = collectd-ceilometer-plugin
|
||||
directory = collectd_openstack/locale
|
||||
domain = collectd-openstack-plugins
|
||||
|
||||
[update_catalog]
|
||||
domain = collectd-ceilometer-plugin
|
||||
output_dir = collectd_ceilometer/locale
|
||||
input_file = collectd_ceilometer/locale/collectd-ceilometer-plugin.pot
|
||||
domain = collectd-openstack-plugins
|
||||
output_dir = collectd_openstack/locale
|
||||
input_file = collectd_openstack/locale/collectd-openstack-plugins.pot
|
||||
|
||||
[extract_messages]
|
||||
keywords = _ gettext ngettext l_ lazy_gettext
|
||||
mapping_file = babel.cfg
|
||||
output_file = collectd_ceilometer/locale/collectd-ceilometer-plugin.pot
|
||||
output_file = collectd_openstack/locale/collectd-openstack-plugins.pot
|
||||
|
||||
[build_releasenotes]
|
||||
all_files = 1
|
||||
|
Loading…
Reference in New Issue
Block a user