Rename to aodh
Change-Id: Ibd4c9811daa6e9e692457ce480a58c964fef7cb9 Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
038ea63f40
commit
8372f48b7a
@ -1,7 +1,7 @@
|
|||||||
[run]
|
[run]
|
||||||
branch = True
|
branch = True
|
||||||
source = ceilometer
|
source = aodh
|
||||||
omit = ceilometer/tests/*, ceilometer/openstack/common/*
|
omit = aodh/tests/*, aodh/openstack/common/*
|
||||||
|
|
||||||
[report]
|
[report]
|
||||||
ignore-errors = True
|
ignore-errors = True
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -11,7 +11,7 @@ cover/*
|
|||||||
dist/*
|
dist/*
|
||||||
doc/build/*
|
doc/build/*
|
||||||
doc/source/sourcecode
|
doc/source/sourcecode
|
||||||
etc/ceilometer/ceilometer.conf
|
etc/aodh/aodh.conf
|
||||||
subunit.log
|
subunit.log
|
||||||
tools/lintstack.head.py
|
tools/lintstack.head.py
|
||||||
tools/pylint_exceptions
|
tools/pylint_exceptions
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
[gerrit]
|
[gerrit]
|
||||||
host=review.openstack.org
|
host=review.openstack.org
|
||||||
port=29418
|
port=29418
|
||||||
project=openstack/ceilometer.git
|
project=openstack/aodh.git
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
|
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
|
||||||
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
|
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
|
||||||
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-600} \
|
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-600} \
|
||||||
${PYTHON:-python} -m subunit.run discover ${OS_TEST_PATH:-./ceilometer/tests} -t . $LISTOPT $IDOPTION
|
${PYTHON:-python} -m subunit.run discover ${OS_TEST_PATH:-./aodh/tests} -t . $LISTOPT $IDOPTION
|
||||||
test_id_option=--load-list $IDFILE
|
test_id_option=--load-list $IDFILE
|
||||||
test_list_option=--list
|
test_list_option=--list
|
||||||
# NOTE(chdent): Only used/matches on gabbi-related tests.
|
# NOTE(chdent): Only used/matches on gabbi-related tests.
|
||||||
|
@ -13,4 +13,4 @@ Pull requests submitted through GitHub will be ignored.
|
|||||||
|
|
||||||
Bugs should be filed on Launchpad, not GitHub:
|
Bugs should be filed on Launchpad, not GitHub:
|
||||||
|
|
||||||
https://bugs.launchpad.net/ceilometer
|
https://bugs.launchpad.net/aodh
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
Ceilometer Style Commandments
|
Aodh Style Commandments
|
||||||
=============================
|
=======================
|
||||||
|
|
||||||
- Step 1: Read the OpenStack Style Commandments
|
- Step 1: Read the OpenStack Style Commandments
|
||||||
http://docs.openstack.org/developer/hacking/
|
http://docs.openstack.org/developer/hacking/
|
||||||
- Step 2: Read on
|
- Step 2: Read on
|
||||||
|
|
||||||
Ceilometer Specific Commandments
|
Aodh Specific Commandments
|
||||||
--------------------------------
|
--------------------------
|
||||||
|
|
||||||
- [C300] Check for oslo library imports use the non-namespaced packages
|
- [C300] Check for oslo library imports use the non-namespaced packages
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
= Generalist Code Reviewers =
|
= Generalist Code Reviewers =
|
||||||
|
|
||||||
The current members of ceilometer-core are listed here:
|
The current members of aodh-core are listed here:
|
||||||
|
|
||||||
https://launchpad.net/~ceilometer-drivers/+members#active
|
https://launchpad.net/~aodh-drivers/+members#active
|
||||||
|
|
||||||
This group can +2 and approve patches in Ceilometer. However, they may
|
This group can +2 and approve patches in aodh. However, they may
|
||||||
choose to seek feedback from the appropriate specialist maintainer before
|
choose to seek feedback from the appropriate specialist maintainer before
|
||||||
approving a patch if it is in any way controversial or risky.
|
approving a patch if it is in any way controversial or risky.
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ Each has an entry with the following keys:
|
|||||||
Maintained: Has an active maintainer
|
Maintained: Has an active maintainer
|
||||||
Orphan: No current maintainer, feel free to step up!
|
Orphan: No current maintainer, feel free to step up!
|
||||||
Obsolete: Replaced by newer code, or a dead end, or out-dated
|
Obsolete: Replaced by newer code, or a dead end, or out-dated
|
||||||
F: Wildcard patterns, relative to ceilometer/
|
F: Wildcard patterns, relative to aodh/
|
||||||
|
|
||||||
|
|
||||||
== alarms ==
|
== alarms ==
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
ceilometer
|
aodh
|
||||||
==========
|
====
|
||||||
|
|
||||||
See the ReleaseNotes document and the project home for more info.
|
See the ReleaseNotes document and the project home for more info.
|
||||||
|
|
||||||
http://launchpad.net/ceilometer
|
http://launchpad.net/aodh
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
Release notes are maintained in rst format in
|
Release notes are maintained in rst format in
|
||||||
doc/source/releasenotes/
|
doc/source/releasenotes/
|
||||||
they can be read online at
|
they can be read online at
|
||||||
http://docs.openstack.org/developer/ceilometer/releasenotes/index.html
|
http://docs.openstack.org/developer/aodh/releasenotes/index.html
|
||||||
|
|
||||||
Documentation for the project can be found at:
|
Documentation for the project can be found at:
|
||||||
http://docs.openstack.org/developer/ceilometer/
|
http://docs.openstack.org/developer/aodh/
|
||||||
|
|
||||||
The project home is at:
|
The project home is at:
|
||||||
http://launchpad.net/ceilometer
|
http://launchpad.net/aodh
|
||||||
|
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
from stevedore import extension
|
from stevedore import extension
|
||||||
|
|
||||||
|
|
||||||
EVALUATOR_EXTENSIONS_NAMESPACE = "ceilometer.alarm.evaluator"
|
EVALUATOR_EXTENSIONS_NAMESPACE = "aodh.alarm.evaluator"
|
||||||
NOTIFIER_EXTENSIONS_NAMESPACE = "ceilometer.alarm.notifier"
|
NOTIFIER_EXTENSIONS_NAMESPACE = "aodh.alarm.notifier"
|
||||||
|
|
||||||
NOTIFIERS = extension.ExtensionManager(NOTIFIER_EXTENSIONS_NAMESPACE,
|
NOTIFIERS = extension.ExtensionManager(NOTIFIER_EXTENSIONS_NAMESPACE,
|
||||||
invoke_on_load=True)
|
invoke_on_load=True)
|
@ -27,7 +27,7 @@ from oslo_utils import timeutils
|
|||||||
import pytz
|
import pytz
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from ceilometer.i18n import _
|
from aodh.i18n import _
|
||||||
|
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
@ -36,8 +36,8 @@ UNKNOWN = 'insufficient data'
|
|||||||
OK = 'ok'
|
OK = 'ok'
|
||||||
ALARM = 'alarm'
|
ALARM = 'alarm'
|
||||||
|
|
||||||
cfg.CONF.import_opt('http_timeout', 'ceilometer.service')
|
cfg.CONF.import_opt('http_timeout', 'aodh.service')
|
||||||
cfg.CONF.import_group('service_credentials', 'ceilometer.service')
|
cfg.CONF.import_group('service_credentials', 'aodh.service')
|
||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
@six.add_metaclass(abc.ABCMeta)
|
@ -19,8 +19,8 @@
|
|||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
from six import moves
|
from six import moves
|
||||||
|
|
||||||
from ceilometer.alarm import evaluator
|
from aodh.alarm import evaluator
|
||||||
from ceilometer.i18n import _
|
from aodh.i18n import _
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
@ -23,9 +23,9 @@ from oslo_utils import timeutils
|
|||||||
import requests
|
import requests
|
||||||
import six.moves
|
import six.moves
|
||||||
|
|
||||||
from ceilometer.alarm import evaluator
|
from aodh.alarm import evaluator
|
||||||
from ceilometer.i18n import _
|
from aodh.i18n import _
|
||||||
from ceilometer import keystone_client
|
from aodh import keystone_client
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ OPTS = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
cfg.CONF.register_opts(OPTS, group="alarms")
|
cfg.CONF.register_opts(OPTS, group="alarms")
|
||||||
cfg.CONF.import_opt('http_timeout', 'ceilometer.service')
|
cfg.CONF.import_opt('http_timeout', 'aodh.service')
|
||||||
|
|
||||||
|
|
||||||
class GnocchiThresholdEvaluator(evaluator.Evaluator):
|
class GnocchiThresholdEvaluator(evaluator.Evaluator):
|
@ -19,9 +19,9 @@ import operator
|
|||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
|
|
||||||
from ceilometer.alarm import evaluator
|
from aodh.alarm import evaluator
|
||||||
from ceilometer.alarm.evaluator import utils
|
from aodh.alarm.evaluator import utils
|
||||||
from ceilometer.i18n import _, _LW
|
from aodh.i18n import _, _LW
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
from ceilometer.alarm import notifier
|
from aodh.alarm import notifier
|
||||||
from ceilometer.i18n import _
|
from aodh.i18n import _
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
@ -22,8 +22,8 @@ from oslo_serialization import jsonutils
|
|||||||
import requests
|
import requests
|
||||||
import six.moves.urllib.parse as urlparse
|
import six.moves.urllib.parse as urlparse
|
||||||
|
|
||||||
from ceilometer.alarm import notifier
|
from aodh.alarm import notifier
|
||||||
from ceilometer.i18n import _
|
from aodh.i18n import _
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ class RestAlarmNotifier(notifier.AlarmNotifier):
|
|||||||
if action.scheme == 'https':
|
if action.scheme == 'https':
|
||||||
default_verify = int(cfg.CONF.alarm.rest_notifier_ssl_verify)
|
default_verify = int(cfg.CONF.alarm.rest_notifier_ssl_verify)
|
||||||
options = urlparse.parse_qs(action.query)
|
options = urlparse.parse_qs(action.query)
|
||||||
verify = bool(int(options.get('ceilometer-alarm-ssl-verify',
|
verify = bool(int(options.get('aodh-alarm-ssl-verify',
|
||||||
[default_verify])[-1]))
|
[default_verify])[-1]))
|
||||||
kwargs['verify'] = verify
|
kwargs['verify'] = verify
|
||||||
|
|
@ -14,7 +14,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
"""Test alarm notifier."""
|
"""Test alarm notifier."""
|
||||||
|
|
||||||
from ceilometer.alarm import notifier
|
from aodh.alarm import notifier
|
||||||
|
|
||||||
|
|
||||||
class TestAlarmNotifier(notifier.AlarmNotifier):
|
class TestAlarmNotifier(notifier.AlarmNotifier):
|
@ -18,18 +18,18 @@ from keystoneclient.v3 import client as keystone_client
|
|||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from six.moves.urllib import parse
|
from six.moves.urllib import parse
|
||||||
|
|
||||||
from ceilometer.alarm.notifier import rest
|
from aodh.alarm.notifier import rest
|
||||||
|
|
||||||
|
|
||||||
cfg.CONF.import_opt('http_timeout', 'ceilometer.service')
|
cfg.CONF.import_opt('http_timeout', 'aodh.service')
|
||||||
cfg.CONF.import_group('service_credentials', 'ceilometer.service')
|
cfg.CONF.import_group('service_credentials', 'aodh.service')
|
||||||
|
|
||||||
|
|
||||||
class TrustRestAlarmNotifier(rest.RestAlarmNotifier):
|
class TrustRestAlarmNotifier(rest.RestAlarmNotifier):
|
||||||
"""Notifier supporting keystone trust authentication.
|
"""Notifier supporting keystone trust authentication.
|
||||||
|
|
||||||
This alarm notifier is intended to be used to call an endpoint using
|
This alarm notifier is intended to be used to call an endpoint using
|
||||||
keystone authentication. It uses the ceilometer service user to
|
keystone authentication. It uses the aodh service user to
|
||||||
authenticate using the trust ID provided.
|
authenticate using the trust ID provided.
|
||||||
|
|
||||||
The URL must be in the form trust+http://trust-id@host/action.
|
The URL must be in the form trust+http://trust-id@host/action.
|
@ -20,14 +20,14 @@ from oslo_context import context
|
|||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from ceilometer.alarm.storage import models
|
from aodh.alarm.storage import models
|
||||||
from ceilometer.i18n import _
|
from aodh.i18n import _
|
||||||
from ceilometer import messaging
|
from aodh import messaging
|
||||||
|
|
||||||
OPTS = [
|
OPTS = [
|
||||||
cfg.StrOpt('notifier_rpc_topic',
|
cfg.StrOpt('notifier_rpc_topic',
|
||||||
default='alarm_notifier',
|
default='alarm_notifier',
|
||||||
help='The topic that ceilometer uses for alarm notifier '
|
help='The topic that aodh uses for alarm notifier '
|
||||||
'messages.'),
|
'messages.'),
|
||||||
]
|
]
|
||||||
|
|
@ -27,11 +27,11 @@ from oslo_utils import netutils
|
|||||||
import six
|
import six
|
||||||
from stevedore import extension
|
from stevedore import extension
|
||||||
|
|
||||||
from ceilometer import alarm as ceilometer_alarm
|
from aodh import alarm as aodh_alarm
|
||||||
from ceilometer.alarm import rpc as rpc_alarm
|
from aodh.alarm import rpc as rpc_alarm
|
||||||
from ceilometer import coordination as coordination
|
from aodh import coordination as coordination
|
||||||
from ceilometer.i18n import _
|
from aodh.i18n import _
|
||||||
from ceilometer import messaging
|
from aodh import messaging
|
||||||
|
|
||||||
|
|
||||||
OPTS = [
|
OPTS = [
|
||||||
@ -45,8 +45,8 @@ OPTS = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
cfg.CONF.register_opts(OPTS, group='alarm')
|
cfg.CONF.register_opts(OPTS, group='alarm')
|
||||||
cfg.CONF.import_opt('http_timeout', 'ceilometer.service')
|
cfg.CONF.import_opt('http_timeout', 'aodh.service')
|
||||||
cfg.CONF.import_group('service_credentials', 'ceilometer.service')
|
cfg.CONF.import_group('service_credentials', 'aodh.service')
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ class AlarmService(object):
|
|||||||
|
|
||||||
def _load_evaluators(self):
|
def _load_evaluators(self):
|
||||||
self.evaluators = extension.ExtensionManager(
|
self.evaluators = extension.ExtensionManager(
|
||||||
namespace=ceilometer_alarm.EVALUATOR_EXTENSIONS_NAMESPACE,
|
namespace=aodh_alarm.EVALUATOR_EXTENSIONS_NAMESPACE,
|
||||||
invoke_on_load=True,
|
invoke_on_load=True,
|
||||||
invoke_args=(rpc_alarm.RPCAlarmNotifier(),)
|
invoke_args=(rpc_alarm.RPCAlarmNotifier(),)
|
||||||
)
|
)
|
||||||
@ -181,7 +181,7 @@ class AlarmNotifierService(os_service.Service):
|
|||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
notifier = ceilometer_alarm.NOTIFIERS[action.scheme].obj
|
notifier = aodh_alarm.NOTIFIERS[action.scheme].obj
|
||||||
except KeyError:
|
except KeyError:
|
||||||
scheme = action.scheme
|
scheme = action.scheme
|
||||||
LOG.error(
|
LOG.error(
|
@ -14,7 +14,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
"""Base classes for storage engines
|
"""Base classes for storage engines
|
||||||
"""
|
"""
|
||||||
import ceilometer
|
import aodh
|
||||||
|
|
||||||
|
|
||||||
class Connection(object):
|
class Connection(object):
|
||||||
@ -55,7 +55,7 @@ class Connection(object):
|
|||||||
:param alarm_type: Optional alarm type.
|
:param alarm_type: Optional alarm type.
|
||||||
:parmr severity: Optional alarm severity
|
:parmr severity: Optional alarm severity
|
||||||
"""
|
"""
|
||||||
raise ceilometer.NotImplementedError('Alarms not implemented')
|
raise aodh.NotImplementedError('Alarms not implemented')
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def create_alarm(alarm):
|
def create_alarm(alarm):
|
||||||
@ -63,17 +63,17 @@ class Connection(object):
|
|||||||
|
|
||||||
:param alarm: The alarm to create.
|
:param alarm: The alarm to create.
|
||||||
"""
|
"""
|
||||||
raise ceilometer.NotImplementedError('Alarms not implemented')
|
raise aodh.NotImplementedError('Alarms not implemented')
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def update_alarm(alarm):
|
def update_alarm(alarm):
|
||||||
"""Update alarm."""
|
"""Update alarm."""
|
||||||
raise ceilometer.NotImplementedError('Alarms not implemented')
|
raise aodh.NotImplementedError('Alarms not implemented')
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def delete_alarm(alarm_id):
|
def delete_alarm(alarm_id):
|
||||||
"""Delete an alarm."""
|
"""Delete an alarm."""
|
||||||
raise ceilometer.NotImplementedError('Alarms not implemented')
|
raise aodh.NotImplementedError('Alarms not implemented')
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_alarm_changes(alarm_id, on_behalf_of,
|
def get_alarm_changes(alarm_id, on_behalf_of,
|
||||||
@ -105,12 +105,12 @@ class Connection(object):
|
|||||||
:param end_timestamp: Optional modified timestamp end range
|
:param end_timestamp: Optional modified timestamp end range
|
||||||
:param end_timestamp_op: Optional timestamp end range operation
|
:param end_timestamp_op: Optional timestamp end range operation
|
||||||
"""
|
"""
|
||||||
raise ceilometer.NotImplementedError('Alarm history not implemented')
|
raise aodh.NotImplementedError('Alarm history not implemented')
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def record_alarm_change(alarm_change):
|
def record_alarm_change(alarm_change):
|
||||||
"""Record alarm change event."""
|
"""Record alarm change event."""
|
||||||
raise ceilometer.NotImplementedError('Alarm history not implemented')
|
raise aodh.NotImplementedError('Alarm history not implemented')
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def clear():
|
def clear():
|
||||||
@ -125,8 +125,8 @@ class Connection(object):
|
|||||||
:param limit: Maximum number of results to return.
|
:param limit: Maximum number of results to return.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
raise ceilometer.NotImplementedError('Complex query for alarms '
|
raise aodh.NotImplementedError('Complex query for alarms '
|
||||||
'is not implemented.')
|
'is not implemented.')
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def query_alarm_history(filter_expr=None, orderby=None, limit=None):
|
def query_alarm_history(filter_expr=None, orderby=None, limit=None):
|
||||||
@ -137,8 +137,8 @@ class Connection(object):
|
|||||||
:param limit: Maximum number of results to return.
|
:param limit: Maximum number of results to return.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
raise ceilometer.NotImplementedError('Complex query for alarms '
|
raise aodh.NotImplementedError('Complex query for alarms '
|
||||||
'history is not implemented.')
|
'history is not implemented.')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_capabilities(cls):
|
def get_capabilities(cls):
|
||||||
@ -162,5 +162,5 @@ class Connection(object):
|
|||||||
:param alarm_history_ttl: Number of seconds to keep alarm history
|
:param alarm_history_ttl: Number of seconds to keep alarm history
|
||||||
records for.
|
records for.
|
||||||
"""
|
"""
|
||||||
raise ceilometer.NotImplementedError('Clearing alarm history '
|
raise aodh.NotImplementedError('Clearing alarm history '
|
||||||
'not implemented')
|
'not implemented')
|
@ -21,15 +21,15 @@ from __future__ import division
|
|||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
import pymongo
|
import pymongo
|
||||||
|
|
||||||
from ceilometer.alarm.storage import pymongo_base
|
from aodh.alarm.storage import pymongo_base
|
||||||
from ceilometer import storage
|
from aodh import storage
|
||||||
from ceilometer.storage.mongo import utils as pymongo_utils
|
from aodh.storage.mongo import utils as pymongo_utils
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class Connection(pymongo_base.Connection):
|
class Connection(pymongo_base.Connection):
|
||||||
"""The db2 alarm storage for Ceilometer."""
|
"""The db2 alarm storage for aodh."""
|
||||||
|
|
||||||
CONNECTION_POOL = pymongo_utils.ConnectionPool()
|
CONNECTION_POOL = pymongo_utils.ConnectionPool()
|
||||||
|
|
@ -16,14 +16,14 @@ import operator
|
|||||||
|
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
import ceilometer
|
import aodh
|
||||||
from ceilometer.alarm.storage import base
|
from aodh.alarm.storage import base
|
||||||
from ceilometer.alarm.storage import models
|
from aodh.alarm.storage import models
|
||||||
from ceilometer.i18n import _
|
from aodh.i18n import _
|
||||||
from ceilometer.storage.hbase import base as hbase_base
|
from aodh.storage.hbase import base as hbase_base
|
||||||
from ceilometer.storage.hbase import migration as hbase_migration
|
from aodh.storage.hbase import migration as hbase_migration
|
||||||
from ceilometer.storage.hbase import utils as hbase_utils
|
from aodh.storage.hbase import utils as hbase_utils
|
||||||
from ceilometer import utils
|
from aodh import utils
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ class Connection(hbase_base.Connection, base.Connection):
|
|||||||
alarm_type=None, severity=None):
|
alarm_type=None, severity=None):
|
||||||
|
|
||||||
if meter:
|
if meter:
|
||||||
raise ceilometer.NotImplementedError(
|
raise aodh.NotImplementedError(
|
||||||
'Filter by meter not implemented')
|
'Filter by meter not implemented')
|
||||||
|
|
||||||
q = hbase_utils.make_query(alarm_id=alarm_id, name=name,
|
q = hbase_utils.make_query(alarm_id=alarm_id, name=name,
|
@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
from ceilometer.alarm.storage import base
|
from aodh.alarm.storage import base
|
||||||
from ceilometer.i18n import _LI
|
from aodh.i18n import _LI
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
@ -24,11 +24,11 @@ from oslo_config import cfg
|
|||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
import pymongo
|
import pymongo
|
||||||
|
|
||||||
from ceilometer.alarm.storage import pymongo_base
|
from aodh.alarm.storage import pymongo_base
|
||||||
from ceilometer import storage
|
from aodh import storage
|
||||||
from ceilometer.storage.mongo import utils as pymongo_utils
|
from aodh.storage.mongo import utils as pymongo_utils
|
||||||
|
|
||||||
cfg.CONF.import_opt('alarm_history_time_to_live', 'ceilometer.alarm.storage',
|
cfg.CONF.import_opt('alarm_history_time_to_live', 'aodh.alarm.storage',
|
||||||
group="database")
|
group="database")
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
@ -21,12 +21,12 @@ from oslo_log import log
|
|||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
from sqlalchemy import desc
|
from sqlalchemy import desc
|
||||||
|
|
||||||
from ceilometer.alarm.storage import base
|
from aodh.alarm.storage import base
|
||||||
from ceilometer.alarm.storage import models as alarm_api_models
|
from aodh.alarm.storage import models as alarm_api_models
|
||||||
from ceilometer.i18n import _LI
|
from aodh.i18n import _LI
|
||||||
from ceilometer.storage.sqlalchemy import models
|
from aodh.storage.sqlalchemy import models
|
||||||
from ceilometer.storage.sqlalchemy import utils as sql_utils
|
from aodh.storage.sqlalchemy import utils as sql_utils
|
||||||
from ceilometer import utils
|
from aodh import utils
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from ceilometer.i18n import _
|
from aodh.i18n import _
|
||||||
from ceilometer.storage import base
|
from aodh.storage import base
|
||||||
|
|
||||||
|
|
||||||
class Alarm(base.Model):
|
class Alarm(base.Model):
|
@ -21,10 +21,10 @@
|
|||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
import pymongo
|
import pymongo
|
||||||
|
|
||||||
from ceilometer.alarm.storage import base
|
from aodh.alarm.storage import base
|
||||||
from ceilometer.alarm.storage import models
|
from aodh.alarm.storage import models
|
||||||
from ceilometer.storage.mongo import utils as pymongo_utils
|
from aodh.storage.mongo import utils as pymongo_utils
|
||||||
from ceilometer import utils
|
from aodh import utils
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
@ -21,16 +21,16 @@ OPTS = [
|
|||||||
default=8777,
|
default=8777,
|
||||||
deprecated_name='metering_api_port',
|
deprecated_name='metering_api_port',
|
||||||
deprecated_group='DEFAULT',
|
deprecated_group='DEFAULT',
|
||||||
help='The port for the ceilometer API server.',
|
help='The port for the aodh API server.',
|
||||||
),
|
),
|
||||||
cfg.StrOpt('host',
|
cfg.StrOpt('host',
|
||||||
default='0.0.0.0',
|
default='0.0.0.0',
|
||||||
help='The listen IP for the ceilometer API server.',
|
help='The listen IP for the aodh API server.',
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
opt_group = cfg.OptGroup(name='api',
|
opt_group = cfg.OptGroup(name='api',
|
||||||
title='Options for the ceilometer-api service')
|
title='Options for the aodh-api service')
|
||||||
CONF.register_group(opt_group)
|
CONF.register_group(opt_group)
|
||||||
CONF.register_opts(OPTS, opt_group)
|
CONF.register_opts(OPTS, opt_group)
|
@ -22,13 +22,13 @@ from paste import deploy
|
|||||||
import pecan
|
import pecan
|
||||||
from werkzeug import serving
|
from werkzeug import serving
|
||||||
|
|
||||||
from ceilometer.api import config as api_config
|
from aodh.api import config as api_config
|
||||||
from ceilometer.api import hooks
|
from aodh.api import hooks
|
||||||
from ceilometer.api import middleware
|
from aodh.api import middleware
|
||||||
from ceilometer.i18n import _
|
from aodh.i18n import _
|
||||||
from ceilometer.i18n import _LW
|
from aodh.i18n import _LW
|
||||||
from ceilometer import service
|
from aodh import service
|
||||||
from ceilometer import storage
|
from aodh import storage
|
||||||
|
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
@ -41,7 +41,7 @@ OPTS = [
|
|||||||
help="Configuration file for WSGI definition of API."
|
help="Configuration file for WSGI definition of API."
|
||||||
),
|
),
|
||||||
cfg.IntOpt('api_workers', default=1,
|
cfg.IntOpt('api_workers', default=1,
|
||||||
help='Number of workers for Ceilometer API server.'),
|
help='Number of workers for aodh API server.'),
|
||||||
]
|
]
|
||||||
|
|
||||||
API_OPTS = [
|
API_OPTS = [
|
@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
See http://pecan.readthedocs.org/en/latest/deployment.html for details.
|
See http://pecan.readthedocs.org/en/latest/deployment.html for details.
|
||||||
"""
|
"""
|
||||||
from ceilometer import service
|
from aodh import service
|
||||||
from ceilometer.api import app
|
from aodh.api import app
|
||||||
|
|
||||||
# Initialize the oslo configuration library and logging
|
# Initialize the oslo configuration library and logging
|
||||||
service.prepare_service([])
|
service.prepare_service([])
|
@ -18,8 +18,8 @@ server = {
|
|||||||
|
|
||||||
# Pecan Application Configurations
|
# Pecan Application Configurations
|
||||||
app = {
|
app = {
|
||||||
'root': 'ceilometer.api.controllers.root.RootController',
|
'root': 'aodh.api.controllers.root.RootController',
|
||||||
'modules': ['ceilometer.api'],
|
'modules': ['aodh.api'],
|
||||||
}
|
}
|
||||||
|
|
||||||
# Custom Configurations must be in Python dictionary format::
|
# Custom Configurations must be in Python dictionary format::
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
import pecan
|
import pecan
|
||||||
|
|
||||||
from ceilometer.api.controllers.v2 import root as v2
|
from aodh.api.controllers.v2 import root as v2
|
||||||
|
|
||||||
MEDIA_TYPE_JSON = 'application/vnd.openstack.telemetry-%s+json'
|
MEDIA_TYPE_JSON = 'application/vnd.openstack.telemetry-%s+json'
|
||||||
MEDIA_TYPE_XML = 'application/vnd.openstack.telemetry-%s+xml'
|
MEDIA_TYPE_XML = 'application/vnd.openstack.telemetry-%s+xml'
|
@ -15,9 +15,9 @@ import pecan
|
|||||||
import wsme
|
import wsme
|
||||||
from wsme import types as wtypes
|
from wsme import types as wtypes
|
||||||
|
|
||||||
from ceilometer.api.controllers.v2 import base
|
from aodh.api.controllers.v2 import base
|
||||||
from ceilometer.api.controllers.v2 import utils as v2_utils
|
from aodh.api.controllers.v2 import utils as v2_utils
|
||||||
from ceilometer.i18n import _
|
from aodh.i18n import _
|
||||||
|
|
||||||
|
|
||||||
class AlarmCombinationRule(base.AlarmRule):
|
class AlarmCombinationRule(base.AlarmRule):
|
@ -19,12 +19,12 @@ import requests
|
|||||||
import wsme
|
import wsme
|
||||||
from wsme import types as wtypes
|
from wsme import types as wtypes
|
||||||
|
|
||||||
from ceilometer.api.controllers.v2 import base
|
from aodh.api.controllers.v2 import base
|
||||||
from ceilometer.api.controllers.v2 import utils as v2_utils
|
from aodh.api.controllers.v2 import utils as v2_utils
|
||||||
from ceilometer import keystone_client
|
from aodh import keystone_client
|
||||||
|
|
||||||
|
|
||||||
cfg.CONF.import_opt('gnocchi_url', 'ceilometer.alarm.evaluator.gnocchi',
|
cfg.CONF.import_opt('gnocchi_url', 'aodh.alarm.evaluator.gnocchi',
|
||||||
group="alarms")
|
group="alarms")
|
||||||
|
|
||||||
|
|
@ -14,10 +14,10 @@
|
|||||||
import wsme
|
import wsme
|
||||||
from wsme import types as wtypes
|
from wsme import types as wtypes
|
||||||
|
|
||||||
from ceilometer.api.controllers.v2 import base
|
from aodh.api.controllers.v2 import base
|
||||||
from ceilometer.api.controllers.v2 import utils as v2_utils
|
from aodh.api.controllers.v2 import utils as v2_utils
|
||||||
from ceilometer.i18n import _
|
from aodh.i18n import _
|
||||||
from ceilometer import storage
|
from aodh import storage
|
||||||
|
|
||||||
|
|
||||||
class AlarmThresholdRule(base.AlarmRule):
|
class AlarmThresholdRule(base.AlarmRule):
|
@ -37,16 +37,16 @@ import wsme
|
|||||||
from wsme import types as wtypes
|
from wsme import types as wtypes
|
||||||
import wsmeext.pecan as wsme_pecan
|
import wsmeext.pecan as wsme_pecan
|
||||||
|
|
||||||
import ceilometer
|
import aodh
|
||||||
from ceilometer import alarm as ceilometer_alarm
|
from aodh import alarm as aodh_alarm
|
||||||
from ceilometer.alarm.storage import models as alarm_models
|
from aodh.alarm.storage import models as alarm_models
|
||||||
from ceilometer.api.controllers.v2.alarm_rules import combination
|
from aodh.api.controllers.v2.alarm_rules import combination
|
||||||
from ceilometer.api.controllers.v2 import base
|
from aodh.api.controllers.v2 import base
|
||||||
from ceilometer.api.controllers.v2 import utils as v2_utils
|
from aodh.api.controllers.v2 import utils as v2_utils
|
||||||
from ceilometer.api import rbac
|
from aodh.api import rbac
|
||||||
from ceilometer.i18n import _
|
from aodh.i18n import _
|
||||||
from ceilometer import messaging
|
from aodh import messaging
|
||||||
from ceilometer import utils
|
from aodh import utils
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
@ -180,7 +180,7 @@ class AlarmTimeConstraint(base.Base):
|
|||||||
timezone='Europe/Ljubljana')
|
timezone='Europe/Ljubljana')
|
||||||
|
|
||||||
|
|
||||||
ALARMS_RULES = extension.ExtensionManager("ceilometer.alarm.rule")
|
ALARMS_RULES = extension.ExtensionManager("aodh.alarm.rule")
|
||||||
LOG.debug("alarm rules plugin loaded: %s" % ",".join(ALARMS_RULES.names()))
|
LOG.debug("alarm rules plugin loaded: %s" % ",".join(ALARMS_RULES.names()))
|
||||||
|
|
||||||
|
|
||||||
@ -309,7 +309,7 @@ class Alarm(base.Base):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def check_alarm_actions(alarm):
|
def check_alarm_actions(alarm):
|
||||||
actions_schema = ceilometer_alarm.NOTIFIER_SCHEMAS
|
actions_schema = aodh_alarm.NOTIFIER_SCHEMAS
|
||||||
max_actions = cfg.CONF.alarm.alarm_max_actions
|
max_actions = cfg.CONF.alarm.alarm_max_actions
|
||||||
for state in state_kind:
|
for state in state_kind:
|
||||||
actions_name = state.replace(" ", "_") + '_actions'
|
actions_name = state.replace(" ", "_") + '_actions'
|
||||||
@ -429,7 +429,7 @@ def _send_notification(event, payload):
|
|||||||
notification = event.replace(" ", "_")
|
notification = event.replace(" ", "_")
|
||||||
notification = "alarm.%s" % notification
|
notification = "alarm.%s" % notification
|
||||||
transport = messaging.get_transport()
|
transport = messaging.get_transport()
|
||||||
notifier = messaging.get_notifier(transport, publisher_id="ceilometer.api")
|
notifier = messaging.get_notifier(transport, publisher_id="aodh.api")
|
||||||
# FIXME(sileht): perhaps we need to copy some infos from the
|
# FIXME(sileht): perhaps we need to copy some infos from the
|
||||||
# pecan request headers like nova does
|
# pecan request headers like nova does
|
||||||
notifier.info(context.RequestContext(), notification, payload)
|
notifier.info(context.RequestContext(), notification, payload)
|
||||||
@ -476,7 +476,7 @@ class AlarmController(rest.RestController):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
self.conn.record_alarm_change(payload)
|
self.conn.record_alarm_change(payload)
|
||||||
except ceilometer.NotImplementedError:
|
except aodh.NotImplementedError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Revert to the pre-json'ed details ...
|
# Revert to the pre-json'ed details ...
|
||||||
@ -645,7 +645,7 @@ class AlarmsController(rest.RestController):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
conn.record_alarm_change(payload)
|
conn.record_alarm_change(payload)
|
||||||
except ceilometer.NotImplementedError:
|
except aodh.NotImplementedError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Revert to the pre-json'ed details ...
|
# Revert to the pre-json'ed details ...
|
@ -30,7 +30,7 @@ import six
|
|||||||
import wsme
|
import wsme
|
||||||
from wsme import types as wtypes
|
from wsme import types as wtypes
|
||||||
|
|
||||||
from ceilometer.i18n import _
|
from aodh.i18n import _
|
||||||
|
|
||||||
|
|
||||||
operation_kind = ('lt', 'le', 'eq', 'ne', 'ge', 'gt')
|
operation_kind = ('lt', 'le', 'eq', 'ne', 'ge', 'gt')
|
@ -23,8 +23,8 @@ from pecan import rest
|
|||||||
from wsme import types as wtypes
|
from wsme import types as wtypes
|
||||||
import wsmeext.pecan as wsme_pecan
|
import wsmeext.pecan as wsme_pecan
|
||||||
|
|
||||||
from ceilometer.api.controllers.v2 import base
|
from aodh.api.controllers.v2 import base
|
||||||
from ceilometer import utils
|
from aodh import utils
|
||||||
|
|
||||||
|
|
||||||
def _flatten_capabilities(capabilities):
|
def _flatten_capabilities(capabilities):
|
@ -28,12 +28,12 @@ from pecan import rest
|
|||||||
from wsme import types as wtypes
|
from wsme import types as wtypes
|
||||||
import wsmeext.pecan as wsme_pecan
|
import wsmeext.pecan as wsme_pecan
|
||||||
|
|
||||||
from ceilometer.alarm.storage import models as alarm_models
|
from aodh.alarm.storage import models as alarm_models
|
||||||
from ceilometer.api.controllers.v2 import alarms
|
from aodh.api.controllers.v2 import alarms
|
||||||
from ceilometer.api.controllers.v2 import base
|
from aodh.api.controllers.v2 import base
|
||||||
from ceilometer.api import rbac
|
from aodh.api import rbac
|
||||||
from ceilometer.i18n import _
|
from aodh.i18n import _
|
||||||
from ceilometer import utils
|
from aodh import utils
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
@ -18,9 +18,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from ceilometer.api.controllers.v2 import alarms
|
from aodh.api.controllers.v2 import alarms
|
||||||
from ceilometer.api.controllers.v2 import capabilities
|
from aodh.api.controllers.v2 import capabilities
|
||||||
from ceilometer.api.controllers.v2 import query
|
from aodh.api.controllers.v2 import query
|
||||||
|
|
||||||
|
|
||||||
class V2Controller(object):
|
class V2Controller(object):
|
@ -26,8 +26,8 @@ from oslo_utils import timeutils
|
|||||||
import pecan
|
import pecan
|
||||||
import wsme
|
import wsme
|
||||||
|
|
||||||
from ceilometer.api.controllers.v2 import base
|
from aodh.api.controllers.v2 import base
|
||||||
from ceilometer.api import rbac
|
from aodh.api import rbac
|
||||||
|
|
||||||
|
|
||||||
def get_auth_project(on_behalf_of=None):
|
def get_auth_project(on_behalf_of=None):
|
@ -26,9 +26,9 @@ from oslo_log import log
|
|||||||
import six
|
import six
|
||||||
import webob
|
import webob
|
||||||
|
|
||||||
from ceilometer.api import hooks
|
from aodh.api import hooks
|
||||||
from ceilometer import i18n
|
from aodh import i18n
|
||||||
from ceilometer.i18n import _
|
from aodh.i18n import _
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
@ -14,8 +14,8 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from ceilometer.api import app
|
from aodh.api import app
|
||||||
from ceilometer import service
|
from aodh import service
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
@ -17,8 +17,8 @@
|
|||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_service import service as os_service
|
from oslo_service import service as os_service
|
||||||
|
|
||||||
from ceilometer.alarm import service as alarm_service
|
from aodh.alarm import service as alarm_service
|
||||||
from ceilometer import service
|
from aodh import service
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
|
|
@ -18,9 +18,9 @@ import logging
|
|||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
from ceilometer.i18n import _LI
|
from aodh.i18n import _LI
|
||||||
from ceilometer import service
|
from aodh import service
|
||||||
from ceilometer import storage
|
from aodh import storage
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
@ -19,8 +19,8 @@ from oslo_config import cfg
|
|||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
import tooz.coordination
|
import tooz.coordination
|
||||||
|
|
||||||
from ceilometer.i18n import _LE, _LI
|
from aodh.i18n import _LE, _LI
|
||||||
from ceilometer import utils
|
from aodh import utils
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
@ -15,14 +15,14 @@
|
|||||||
"""
|
"""
|
||||||
Guidelines for writing new hacking checks
|
Guidelines for writing new hacking checks
|
||||||
|
|
||||||
- Use only for Ceilometer specific tests. OpenStack general tests
|
- Use only for aodh specific tests. OpenStack general tests
|
||||||
should be submitted to the common 'hacking' module.
|
should be submitted to the common 'hacking' module.
|
||||||
- Pick numbers in the range C3xx. Find the current test with
|
- Pick numbers in the range C3xx. Find the current test with
|
||||||
the highest allocated number and then pick the next value.
|
the highest allocated number and then pick the next value.
|
||||||
- Keep the test method code in the source file ordered based
|
- Keep the test method code in the source file ordered based
|
||||||
on the C3xx value.
|
on the C3xx value.
|
||||||
- List the new rule in the top level HACKING.rst file
|
- List the new rule in the top level HACKING.rst file
|
||||||
- Add test cases for each new rule to ceilometer/tests/test_hacking.py
|
- Add test cases for each new rule to aodh/tests/test_hacking.py
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ oslo_namespace_imports = re.compile(
|
|||||||
|
|
||||||
def check_oslo_namespace_imports(logical_line, physical_line, filename):
|
def check_oslo_namespace_imports(logical_line, physical_line, filename):
|
||||||
# ignore openstack.common since they are not maintained by us
|
# ignore openstack.common since they are not maintained by us
|
||||||
if 'ceilometer/openstack/common/' in filename:
|
if 'aodh/openstack/common/' in filename:
|
||||||
return
|
return
|
||||||
|
|
||||||
if re.match(oslo_namespace_imports, logical_line):
|
if re.match(oslo_namespace_imports, logical_line):
|
@ -20,7 +20,7 @@ See http://docs.openstack.org/developer/oslo.i18n/usage.html
|
|||||||
|
|
||||||
import oslo_i18n
|
import oslo_i18n
|
||||||
|
|
||||||
DOMAIN = 'ceilometer'
|
DOMAIN = 'aodh'
|
||||||
|
|
||||||
_translators = oslo_i18n.TranslatorFactory(domain=DOMAIN)
|
_translators = oslo_i18n.TranslatorFactory(domain=DOMAIN)
|
||||||
|
|
@ -17,8 +17,8 @@
|
|||||||
from keystoneclient.v2_0 import client as ksclient
|
from keystoneclient.v2_0 import client as ksclient
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
cfg.CONF.import_group('service_credentials', 'ceilometer.service')
|
cfg.CONF.import_group('service_credentials', 'aodh.service')
|
||||||
cfg.CONF.import_opt('http_timeout', 'ceilometer.service')
|
cfg.CONF.import_opt('http_timeout', 'aodh.service')
|
||||||
|
|
||||||
|
|
||||||
def get_client():
|
def get_client():
|
@ -52,7 +52,7 @@ class JsonPayloadSerializer(oslo_messaging.NoOpSerializer):
|
|||||||
|
|
||||||
|
|
||||||
def setup():
|
def setup():
|
||||||
oslo_messaging.set_transport_defaults('ceilometer')
|
oslo_messaging.set_transport_defaults('aodh')
|
||||||
|
|
||||||
|
|
||||||
def get_transport(url=None, optional=False, cache=True):
|
def get_transport(url=None, optional=False, cache=True):
|
||||||
@ -86,7 +86,7 @@ def cleanup():
|
|||||||
|
|
||||||
def get_rpc_server(transport, topic, endpoint):
|
def get_rpc_server(transport, topic, endpoint):
|
||||||
"""Return a configured oslo_messaging rpc server."""
|
"""Return a configured oslo_messaging rpc server."""
|
||||||
cfg.CONF.import_opt('host', 'ceilometer.service')
|
cfg.CONF.import_opt('host', 'aodh.service')
|
||||||
target = oslo_messaging.Target(server=cfg.CONF.host, topic=topic)
|
target = oslo_messaging.Target(server=cfg.CONF.host, topic=topic)
|
||||||
serializer = RequestContextSerializer(JsonPayloadSerializer())
|
serializer = RequestContextSerializer(JsonPayloadSerializer())
|
||||||
return oslo_messaging.get_rpc_server(transport, target,
|
return oslo_messaging.get_rpc_server(transport, target,
|
@ -24,7 +24,7 @@ try:
|
|||||||
# repository. It is OK to have more than one translation function
|
# repository. It is OK to have more than one translation function
|
||||||
# using the same domain, since there will still only be one message
|
# using the same domain, since there will still only be one message
|
||||||
# catalog.
|
# catalog.
|
||||||
_translators = oslo_i18n.TranslatorFactory(domain='ceilometer')
|
_translators = oslo_i18n.TranslatorFactory(domain='aodh')
|
||||||
|
|
||||||
# The primary translation function using the well-known name "_"
|
# The primary translation function using the well-known name "_"
|
||||||
_ = _translators.primary
|
_ = _translators.primary
|
45
aodh/opts.py
Normal file
45
aodh/opts.py
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# Copyright 2014 eNovance
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
import itertools
|
||||||
|
|
||||||
|
import aodh.alarm.notifier.rest
|
||||||
|
import aodh.alarm.rpc
|
||||||
|
import aodh.alarm.service
|
||||||
|
import aodh.api
|
||||||
|
import aodh.api.app
|
||||||
|
import aodh.api.controllers.v2.alarms
|
||||||
|
import aodh.coordination
|
||||||
|
import aodh.service
|
||||||
|
import aodh.storage
|
||||||
|
|
||||||
|
|
||||||
|
def list_opts():
|
||||||
|
return [
|
||||||
|
('DEFAULT',
|
||||||
|
itertools.chain(aodh.api.app.OPTS,
|
||||||
|
aodh.service.OPTS,
|
||||||
|
aodh.storage.OLD_OPTS,)),
|
||||||
|
('alarm',
|
||||||
|
itertools.chain(aodh.alarm.notifier.rest.OPTS,
|
||||||
|
aodh.alarm.service.OPTS,
|
||||||
|
aodh.alarm.rpc.OPTS,
|
||||||
|
aodh.alarm.evaluator.gnocchi.OPTS,
|
||||||
|
aodh.api.controllers.v2.alarms.ALARM_API_OPTS)),
|
||||||
|
('api',
|
||||||
|
itertools.chain(aodh.api.OPTS,
|
||||||
|
aodh.api.app.API_OPTS,)),
|
||||||
|
('coordination', aodh.coordination.OPTS),
|
||||||
|
('database', aodh.storage.OPTS),
|
||||||
|
('service_credentials', aodh.service.CLI_OPTS),
|
||||||
|
]
|
@ -22,9 +22,9 @@ from oslo_config import cfg
|
|||||||
import oslo_i18n
|
import oslo_i18n
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
from ceilometer.i18n import _
|
from aodh.i18n import _
|
||||||
from ceilometer import messaging
|
from aodh import messaging
|
||||||
from ceilometer import utils
|
from aodh import utils
|
||||||
|
|
||||||
|
|
||||||
OPTS = [
|
OPTS = [
|
||||||
@ -47,7 +47,7 @@ cfg.CONF.register_opts(OPTS)
|
|||||||
CLI_OPTS = [
|
CLI_OPTS = [
|
||||||
cfg.StrOpt('os-username',
|
cfg.StrOpt('os-username',
|
||||||
deprecated_group="DEFAULT",
|
deprecated_group="DEFAULT",
|
||||||
default=os.environ.get('OS_USERNAME', 'ceilometer'),
|
default=os.environ.get('OS_USERNAME', 'aodh'),
|
||||||
help='User name to use for OpenStack service access.'),
|
help='User name to use for OpenStack service access.'),
|
||||||
cfg.StrOpt('os-password',
|
cfg.StrOpt('os-password',
|
||||||
deprecated_group="DEFAULT",
|
deprecated_group="DEFAULT",
|
||||||
@ -111,6 +111,6 @@ def prepare_service(argv=None):
|
|||||||
log.set_defaults(default_log_levels=log_levels)
|
log.set_defaults(default_log_levels=log_levels)
|
||||||
if argv is None:
|
if argv is None:
|
||||||
argv = sys.argv
|
argv = sys.argv
|
||||||
cfg.CONF(argv[1:], project='ceilometer', validate_default_values=True)
|
cfg.CONF(argv[1:], project='aodh', validate_default_values=True)
|
||||||
log.setup(cfg.CONF, 'ceilometer')
|
log.setup(cfg.CONF, 'aodh')
|
||||||
messaging.setup()
|
messaging.setup()
|
@ -22,7 +22,7 @@ import retrying
|
|||||||
import six.moves.urllib.parse as urlparse
|
import six.moves.urllib.parse as urlparse
|
||||||
from stevedore import driver
|
from stevedore import driver
|
||||||
|
|
||||||
from ceilometer import utils
|
from aodh import utils
|
||||||
|
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
@ -98,7 +98,7 @@ def get_connection_from_config(conf, purpose='alarm'):
|
|||||||
if conf.database_connection:
|
if conf.database_connection:
|
||||||
conf.set_override('connection', conf.database_connection,
|
conf.set_override('connection', conf.database_connection,
|
||||||
group='database')
|
group='database')
|
||||||
namespace = 'ceilometer.%s.storage' % purpose
|
namespace = 'aodh.%s.storage' % purpose
|
||||||
url = (getattr(conf.database, '%s_connection' % purpose) or
|
url = (getattr(conf.database, '%s_connection' % purpose) or
|
||||||
conf.database.connection)
|
conf.database.connection)
|
||||||
return get_connection(url, namespace)
|
return get_connection(url, namespace)
|
@ -18,8 +18,8 @@ from oslo_log import log
|
|||||||
from oslo_utils import netutils
|
from oslo_utils import netutils
|
||||||
from six.moves.urllib import parse as urlparse
|
from six.moves.urllib import parse as urlparse
|
||||||
|
|
||||||
from ceilometer.i18n import _
|
from aodh.i18n import _
|
||||||
from ceilometer.storage.hbase import inmemory as hbase_inmemory
|
from aodh.storage.hbase import inmemory as hbase_inmemory
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ class Connection(object):
|
|||||||
opts = self._parse_connection_url(url)
|
opts = self._parse_connection_url(url)
|
||||||
|
|
||||||
if opts['host'] == '__test__':
|
if opts['host'] == '__test__':
|
||||||
url = os.environ.get('CEILOMETER_TEST_HBASE_URL')
|
url = os.environ.get('AODH_TEST_HBASE_URL')
|
||||||
if url:
|
if url:
|
||||||
# Reparse URL, but from the env variable now
|
# Reparse URL, but from the env variable now
|
||||||
opts = self._parse_connection_url(url)
|
opts = self._parse_connection_url(url)
|
@ -20,8 +20,8 @@ import re
|
|||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
import six
|
import six
|
||||||
|
|
||||||
import ceilometer
|
import aodh
|
||||||
from ceilometer.i18n import _
|
from aodh.i18n import _
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ class MTable(object):
|
|||||||
# in case of multiple filters
|
# in case of multiple filters
|
||||||
rows = m(fargs, rows)
|
rows = m(fargs, rows)
|
||||||
else:
|
else:
|
||||||
raise ceilometer.NotImplementedError(
|
raise aodh.NotImplementedError(
|
||||||
"%s filter is not implemented, "
|
"%s filter is not implemented, "
|
||||||
"you may want to add it!")
|
"you may want to add it!")
|
||||||
for k in sorted(rows)[:limit]:
|
for k in sorted(rows)[:limit]:
|
||||||
@ -198,7 +198,7 @@ class MTable(object):
|
|||||||
if g == row:
|
if g == row:
|
||||||
r[row] = data
|
r[row] = data
|
||||||
else:
|
else:
|
||||||
raise ceilometer.NotImplementedError(
|
raise aodh.NotImplementedError(
|
||||||
"In-memory "
|
"In-memory "
|
||||||
"RowFilter doesn't support "
|
"RowFilter doesn't support "
|
||||||
"the %s operation yet" % op)
|
"the %s operation yet" % op)
|
||||||
@ -235,7 +235,7 @@ class MTable(object):
|
|||||||
(is_regex and re.search(value, key))):
|
(is_regex and re.search(value, key))):
|
||||||
r_data[key] = data[key]
|
r_data[key] = data[key]
|
||||||
else:
|
else:
|
||||||
raise ceilometer.NotImplementedError(
|
raise aodh.NotImplementedError(
|
||||||
"In-memory QualifierFilter "
|
"In-memory QualifierFilter "
|
||||||
"doesn't support the %s "
|
"doesn't support the %s "
|
||||||
"operation yet" % op)
|
"operation yet" % op)
|
@ -14,7 +14,7 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
from ceilometer.storage.hbase import utils as hbase_utils
|
from aodh.storage.hbase import utils as hbase_utils
|
||||||
|
|
||||||
|
|
||||||
def migrate_alarm_history_table(conn, table):
|
def migrate_alarm_history_table(conn, table):
|
@ -21,8 +21,8 @@ from happybase.hbase import ttypes
|
|||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from ceilometer.i18n import _
|
from aodh.i18n import _
|
||||||
from ceilometer import utils
|
from aodh import utils
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
@ -26,7 +26,7 @@ from oslo_log import log
|
|||||||
from oslo_utils import netutils
|
from oslo_utils import netutils
|
||||||
import pymongo
|
import pymongo
|
||||||
|
|
||||||
from ceilometer.i18n import _
|
from aodh.i18n import _
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
@ -11,7 +11,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
SQLAlchemy models for Ceilometer data.
|
SQLAlchemy models for aodh data.
|
||||||
"""
|
"""
|
||||||
import json
|
import json
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ from sqlalchemy.dialects.mysql import DECIMAL
|
|||||||
from sqlalchemy.ext.declarative import declarative_base
|
from sqlalchemy.ext.declarative import declarative_base
|
||||||
from sqlalchemy.types import TypeDecorator
|
from sqlalchemy.types import TypeDecorator
|
||||||
|
|
||||||
from ceilometer import utils
|
from aodh import utils
|
||||||
|
|
||||||
|
|
||||||
class JSONEncodedDict(TypeDecorator):
|
class JSONEncodedDict(TypeDecorator):
|
||||||
@ -72,8 +72,8 @@ class PreciseTimestamp(TypeDecorator):
|
|||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
||||||
class CeilometerBase(object):
|
class AodhBase(object):
|
||||||
"""Base class for Ceilometer Models."""
|
"""Base class for Aodh Models."""
|
||||||
__table_args__ = {'mysql_charset': "utf8",
|
__table_args__ = {'mysql_charset': "utf8",
|
||||||
'mysql_engine': "InnoDB"}
|
'mysql_engine': "InnoDB"}
|
||||||
__table_initialized__ = False
|
__table_initialized__ = False
|
||||||
@ -90,7 +90,7 @@ class CeilometerBase(object):
|
|||||||
setattr(self, k, v)
|
setattr(self, k, v)
|
||||||
|
|
||||||
|
|
||||||
Base = declarative_base(cls=CeilometerBase)
|
Base = declarative_base(cls=AodhBase)
|
||||||
|
|
||||||
|
|
||||||
class Alarm(Base):
|
class Alarm(Base):
|
@ -12,7 +12,7 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
"""Base class for tests in ceilometer/alarm/evaluator/
|
"""Base class for tests in aodh/alarm/evaluator/
|
||||||
"""
|
"""
|
||||||
import mock
|
import mock
|
||||||
from oslotest import base
|
from oslotest import base
|
@ -12,7 +12,7 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
"""class for tests in ceilometer/alarm/evaluator/__init__.py
|
"""class for tests in aodh/alarm/evaluator/__init__.py
|
||||||
"""
|
"""
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ import mock
|
|||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
from oslotest import base
|
from oslotest import base
|
||||||
|
|
||||||
from ceilometer.alarm import evaluator
|
from aodh.alarm import evaluator
|
||||||
|
|
||||||
|
|
||||||
class TestEvaluatorBaseClass(base.BaseTestCase):
|
class TestEvaluatorBaseClass(base.BaseTestCase):
|
@ -15,7 +15,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
"""Tests for ceilometer/alarm/evaluator/combination.py
|
"""Tests for aodh/alarm/evaluator/combination.py
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
@ -27,10 +27,10 @@ import mock
|
|||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
import pytz
|
import pytz
|
||||||
|
|
||||||
from ceilometer.alarm.evaluator import combination
|
from aodh.alarm.evaluator import combination
|
||||||
from ceilometer.alarm.storage import models
|
from aodh.alarm.storage import models
|
||||||
from ceilometer.tests.alarm.evaluator import base
|
from aodh.tests.alarm.evaluator import base
|
||||||
from ceilometer.tests import constants
|
from aodh.tests import constants
|
||||||
|
|
||||||
|
|
||||||
class TestEvaluate(base.TestEvaluatorBase):
|
class TestEvaluate(base.TestEvaluatorBase):
|
@ -25,10 +25,10 @@ import pytz
|
|||||||
import six
|
import six
|
||||||
from six import moves
|
from six import moves
|
||||||
|
|
||||||
from ceilometer.alarm.evaluator import gnocchi
|
from aodh.alarm.evaluator import gnocchi
|
||||||
from ceilometer.alarm.storage import models
|
from aodh.alarm.storage import models
|
||||||
from ceilometer.tests.alarm.evaluator import base
|
from aodh.tests.alarm.evaluator import base
|
||||||
from ceilometer.tests import constants
|
from aodh.tests import constants
|
||||||
|
|
||||||
|
|
||||||
class FakeResponse(object):
|
class FakeResponse(object):
|
||||||
@ -56,7 +56,7 @@ class TestGnocchiThresholdEvaluate(base.TestEvaluatorBase):
|
|||||||
self.useFixture(mockpatch.Patch('ceilometerclient.client.get_client',
|
self.useFixture(mockpatch.Patch('ceilometerclient.client.get_client',
|
||||||
return_value=self.api_client))
|
return_value=self.api_client))
|
||||||
self.requests = self.useFixture(mockpatch.Patch(
|
self.requests = self.useFixture(mockpatch.Patch(
|
||||||
'ceilometer.alarm.evaluator.gnocchi.requests')).mock
|
'aodh.alarm.evaluator.gnocchi.requests')).mock
|
||||||
|
|
||||||
def prepare_alarms(self):
|
def prepare_alarms(self):
|
||||||
self.alarms = [
|
self.alarms = [
|
||||||
@ -412,7 +412,7 @@ class TestGnocchiThresholdEvaluate(base.TestEvaluatorBase):
|
|||||||
self.assertEqual(expected, self.notifier.notify.call_args_list)
|
self.assertEqual(expected, self.notifier.notify.call_args_list)
|
||||||
|
|
||||||
@unittest.skipIf(six.PY3,
|
@unittest.skipIf(six.PY3,
|
||||||
"the ceilometer base class is not python 3 ready")
|
"the aodh base class is not python 3 ready")
|
||||||
@mock.patch.object(timeutils, 'utcnow')
|
@mock.patch.object(timeutils, 'utcnow')
|
||||||
def test_no_state_change_outside_time_constraint(self, mock_utcnow):
|
def test_no_state_change_outside_time_constraint(self, mock_utcnow):
|
||||||
self._set_all_alarms('ok')
|
self._set_all_alarms('ok')
|
@ -12,7 +12,7 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
"""Tests for ceilometer/alarm/evaluator/threshold.py
|
"""Tests for aodh/alarm/evaluator/threshold.py
|
||||||
"""
|
"""
|
||||||
import datetime
|
import datetime
|
||||||
import uuid
|
import uuid
|
||||||
@ -25,10 +25,10 @@ from oslo_utils import timeutils
|
|||||||
import pytz
|
import pytz
|
||||||
from six import moves
|
from six import moves
|
||||||
|
|
||||||
from ceilometer.alarm.evaluator import threshold
|
from aodh.alarm.evaluator import threshold
|
||||||
from ceilometer.alarm.storage import models
|
from aodh.alarm.storage import models
|
||||||
from ceilometer.tests.alarm.evaluator import base
|
from aodh.tests.alarm.evaluator import base
|
||||||
from ceilometer.tests import constants
|
from aodh.tests import constants
|
||||||
|
|
||||||
|
|
||||||
class TestEvaluate(base.TestEvaluatorBase):
|
class TestEvaluate(base.TestEvaluatorBase):
|
@ -12,14 +12,14 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
"""Tests for ceilometer.alarm.service.SingletonAlarmService.
|
"""Tests for aodh.alarm.service.SingletonAlarmService.
|
||||||
"""
|
"""
|
||||||
import mock
|
import mock
|
||||||
from oslo_config import fixture as fixture_config
|
from oslo_config import fixture as fixture_config
|
||||||
from stevedore import extension
|
from stevedore import extension
|
||||||
|
|
||||||
from ceilometer.alarm import service
|
from aodh.alarm import service
|
||||||
from ceilometer.tests import base as tests_base
|
from aodh.tests import base as tests_base
|
||||||
|
|
||||||
|
|
||||||
class TestAlarmEvaluationService(tests_base.BaseTestCase):
|
class TestAlarmEvaluationService(tests_base.BaseTestCase):
|
@ -21,9 +21,9 @@ from oslotest import mockpatch
|
|||||||
import requests
|
import requests
|
||||||
import six.moves.urllib.parse as urlparse
|
import six.moves.urllib.parse as urlparse
|
||||||
|
|
||||||
from ceilometer import alarm as ceilometer_alarm
|
from aodh import alarm as aodh_alarm
|
||||||
from ceilometer.alarm import service
|
from aodh.alarm import service
|
||||||
from ceilometer.tests import base as tests_base
|
from aodh.tests import base as tests_base
|
||||||
|
|
||||||
|
|
||||||
DATA_JSON = jsonutils.loads(
|
DATA_JSON = jsonutils.loads(
|
||||||
@ -71,7 +71,7 @@ class TestAlarmNotifier(tests_base.BaseTestCase):
|
|||||||
'reason_data': {'fire': 'everywhere'}
|
'reason_data': {'fire': 'everywhere'}
|
||||||
}
|
}
|
||||||
self.service.notify_alarm(context.get_admin_context(), data)
|
self.service.notify_alarm(context.get_admin_context(), data)
|
||||||
notifications = ceilometer_alarm.NOTIFIERS['test'].obj.notifications
|
notifications = aodh_alarm.NOTIFIERS['test'].obj.notifications
|
||||||
self.assertEqual(1, len(notifications))
|
self.assertEqual(1, len(notifications))
|
||||||
self.assertEqual((urlparse.urlsplit(data['actions'][0]),
|
self.assertEqual((urlparse.urlsplit(data['actions'][0]),
|
||||||
data['alarm_id'],
|
data['alarm_id'],
|
||||||
@ -180,7 +180,7 @@ class TestAlarmNotifier(tests_base.BaseTestCase):
|
|||||||
self.assertEqual(DATA_JSON, jsonutils.loads(kwargs['data']))
|
self.assertEqual(DATA_JSON, jsonutils.loads(kwargs['data']))
|
||||||
|
|
||||||
def test_notify_alarm_rest_action_with_ssl_verify_disable(self):
|
def test_notify_alarm_rest_action_with_ssl_verify_disable(self):
|
||||||
action = 'https://host/action?ceilometer-alarm-ssl-verify=0'
|
action = 'https://host/action?aodh-alarm-ssl-verify=0'
|
||||||
|
|
||||||
with mock.patch('eventlet.spawn_n', self._fake_spawn_n):
|
with mock.patch('eventlet.spawn_n', self._fake_spawn_n):
|
||||||
with mock.patch.object(requests.Session, 'post') as poster:
|
with mock.patch.object(requests.Session, 'post') as poster:
|
||||||
@ -194,7 +194,7 @@ class TestAlarmNotifier(tests_base.BaseTestCase):
|
|||||||
self.assertEqual(DATA_JSON, jsonutils.loads(kwargs['data']))
|
self.assertEqual(DATA_JSON, jsonutils.loads(kwargs['data']))
|
||||||
|
|
||||||
def test_notify_alarm_rest_action_with_ssl_verify_enable_by_user(self):
|
def test_notify_alarm_rest_action_with_ssl_verify_enable_by_user(self):
|
||||||
action = 'https://host/action?ceilometer-alarm-ssl-verify=1'
|
action = 'https://host/action?aodh-alarm-ssl-verify=1'
|
||||||
|
|
||||||
self.CONF.set_override("rest_notifier_ssl_verify", False,
|
self.CONF.set_override("rest_notifier_ssl_verify", False,
|
||||||
group='alarm')
|
group='alarm')
|
||||||
@ -218,7 +218,7 @@ class TestAlarmNotifier(tests_base.BaseTestCase):
|
|||||||
with mock.patch('oslo_utils.netutils.urlsplit',
|
with mock.patch('oslo_utils.netutils.urlsplit',
|
||||||
self._fake_urlsplit):
|
self._fake_urlsplit):
|
||||||
LOG = mock.MagicMock()
|
LOG = mock.MagicMock()
|
||||||
with mock.patch('ceilometer.alarm.service.LOG', LOG):
|
with mock.patch('aodh.alarm.service.LOG', LOG):
|
||||||
self.service.notify_alarm(
|
self.service.notify_alarm(
|
||||||
context.get_admin_context(),
|
context.get_admin_context(),
|
||||||
{
|
{
|
||||||
@ -230,7 +230,7 @@ class TestAlarmNotifier(tests_base.BaseTestCase):
|
|||||||
|
|
||||||
def test_notify_alarm_invalid_action(self):
|
def test_notify_alarm_invalid_action(self):
|
||||||
LOG = mock.MagicMock()
|
LOG = mock.MagicMock()
|
||||||
with mock.patch('ceilometer.alarm.service.LOG', LOG):
|
with mock.patch('aodh.alarm.service.LOG', LOG):
|
||||||
self.service.notify_alarm(
|
self.service.notify_alarm(
|
||||||
context.get_admin_context(),
|
context.get_admin_context(),
|
||||||
{
|
{
|
@ -21,10 +21,10 @@ from ceilometerclient.v2 import alarms
|
|||||||
from oslo_config import fixture as fixture_config
|
from oslo_config import fixture as fixture_config
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from ceilometer.alarm import rpc as rpc_alarm
|
from aodh.alarm import rpc as rpc_alarm
|
||||||
from ceilometer.alarm.storage import models
|
from aodh.alarm.storage import models
|
||||||
from ceilometer import messaging
|
from aodh import messaging
|
||||||
from ceilometer.tests import base as tests_base
|
from aodh.tests import base as tests_base
|
||||||
|
|
||||||
|
|
||||||
class FakeNotifier(object):
|
class FakeNotifier(object):
|
@ -21,7 +21,7 @@ from oslo_policy import opts
|
|||||||
import pecan
|
import pecan
|
||||||
import pecan.testing
|
import pecan.testing
|
||||||
|
|
||||||
from ceilometer.tests import db as db_test_base
|
from aodh.tests import db as db_test_base
|
||||||
|
|
||||||
OPT_GROUP_NAME = 'keystone_authtoken'
|
OPT_GROUP_NAME = 'keystone_authtoken'
|
||||||
cfg.CONF.import_group(OPT_GROUP_NAME, "keystonemiddleware.auth_token")
|
cfg.CONF.import_group(OPT_GROUP_NAME, "keystonemiddleware.auth_token")
|
||||||
@ -45,15 +45,15 @@ class FunctionalTest(db_test_base.TestBase):
|
|||||||
self.CONF.set_override("auth_version", "v2.0",
|
self.CONF.set_override("auth_version", "v2.0",
|
||||||
group=OPT_GROUP_NAME)
|
group=OPT_GROUP_NAME)
|
||||||
self.CONF.set_override("policy_file",
|
self.CONF.set_override("policy_file",
|
||||||
self.path_get('etc/ceilometer/policy.json'),
|
self.path_get('etc/aodh/policy.json'),
|
||||||
group='oslo_policy')
|
group='oslo_policy')
|
||||||
self.app = self._make_app()
|
self.app = self._make_app()
|
||||||
|
|
||||||
def _make_app(self, enable_acl=False):
|
def _make_app(self, enable_acl=False):
|
||||||
self.config = {
|
self.config = {
|
||||||
'app': {
|
'app': {
|
||||||
'root': 'ceilometer.api.controllers.root.RootController',
|
'root': 'aodh.api.controllers.root.RootController',
|
||||||
'modules': ['ceilometer.api'],
|
'modules': ['aodh.api'],
|
||||||
'enable_acl': enable_acl,
|
'enable_acl': enable_acl,
|
||||||
},
|
},
|
||||||
'wsme': {
|
'wsme': {
|
@ -20,8 +20,8 @@ from oslo_config import cfg
|
|||||||
from oslo_config import fixture as fixture_config
|
from oslo_config import fixture as fixture_config
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
from ceilometer.api import app
|
from aodh.api import app
|
||||||
from ceilometer.tests import base
|
from aodh.tests import base
|
||||||
|
|
||||||
|
|
||||||
class TestApp(base.BaseTestCase):
|
class TestApp(base.BaseTestCase):
|
||||||
@ -37,7 +37,7 @@ class TestApp(base.BaseTestCase):
|
|||||||
ff.return_value = None
|
ff.return_value = None
|
||||||
self.assertRaises(cfg.ConfigFilesNotFoundError, app.load_app)
|
self.assertRaises(cfg.ConfigFilesNotFoundError, app.load_app)
|
||||||
|
|
||||||
@mock.patch('ceilometer.storage.get_connection_from_config',
|
@mock.patch('aodh.storage.get_connection_from_config',
|
||||||
mock.MagicMock())
|
mock.MagicMock())
|
||||||
@mock.patch('pecan.make_app')
|
@mock.patch('pecan.make_app')
|
||||||
def test_pecan_debug(self, mocked):
|
def test_pecan_debug(self, mocked):
|
@ -13,7 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from ceilometer.tests import api
|
from aodh.tests import api
|
||||||
|
|
||||||
V2_MEDIA_TYPES = [
|
V2_MEDIA_TYPES = [
|
||||||
{
|
{
|
@ -13,7 +13,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from ceilometer.tests import api
|
from aodh.tests import api
|
||||||
|
|
||||||
|
|
||||||
class FunctionalTest(api.FunctionalTest):
|
class FunctionalTest(api.FunctionalTest):
|
@ -21,10 +21,10 @@ import json
|
|||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
import webtest
|
import webtest
|
||||||
|
|
||||||
from ceilometer.api import app
|
from aodh.api import app
|
||||||
from ceilometer.tests import api as acl
|
from aodh.tests import api as acl
|
||||||
from ceilometer.tests.api import v2
|
from aodh.tests.api import v2
|
||||||
from ceilometer.tests import db as tests_db
|
from aodh.tests import db as tests_db
|
||||||
|
|
||||||
VALID_TOKEN = '4562138218392831'
|
VALID_TOKEN = '4562138218392831'
|
||||||
VALID_TOKEN2 = '4562138218392832'
|
VALID_TOKEN2 = '4562138218392832'
|
||||||
@ -90,7 +90,7 @@ class TestAPIACL(v2.FunctionalTest,
|
|||||||
|
|
||||||
def _make_app(self):
|
def _make_app(self):
|
||||||
self.CONF.set_override("cache", "fake.cache", group=acl.OPT_GROUP_NAME)
|
self.CONF.set_override("cache", "fake.cache", group=acl.OPT_GROUP_NAME)
|
||||||
file_name = self.path_get('etc/ceilometer/api_paste.ini')
|
file_name = self.path_get('etc/aodh/api_paste.ini')
|
||||||
self.CONF.set_override("api_paste_config", file_name)
|
self.CONF.set_override("api_paste_config", file_name)
|
||||||
return webtest.TestApp(app.load_app())
|
return webtest.TestApp(app.load_app())
|
||||||
|
|
@ -25,11 +25,11 @@ import six
|
|||||||
from six import moves
|
from six import moves
|
||||||
import six.moves.urllib.parse as urlparse
|
import six.moves.urllib.parse as urlparse
|
||||||
|
|
||||||
from ceilometer.alarm.storage import models
|
from aodh.alarm.storage import models
|
||||||
from ceilometer import messaging
|
from aodh import messaging
|
||||||
from ceilometer.tests.api import v2
|
from aodh.tests.api import v2
|
||||||
from ceilometer.tests import constants
|
from aodh.tests import constants
|
||||||
from ceilometer.tests import db as tests_db
|
from aodh.tests import db as tests_db
|
||||||
|
|
||||||
|
|
||||||
class TestListEmptyAlarms(v2.FunctionalTest,
|
class TestListEmptyAlarms(v2.FunctionalTest,
|
||||||
@ -2496,7 +2496,7 @@ class TestAlarms(v2.FunctionalTest,
|
|||||||
'user_identity': '- - - - -',
|
'user_identity': '- - - - -',
|
||||||
'request_id': mock.ANY,
|
'request_id': mock.ANY,
|
||||||
'user_domain': None},
|
'user_domain': None},
|
||||||
'ceilometer.api', 'alarm.creation',
|
'aodh.api', 'alarm.creation',
|
||||||
PayloadMatcher(), mock.ANY)
|
PayloadMatcher(), mock.ANY)
|
||||||
|
|
||||||
def test_alarm_sends_notification(self):
|
def test_alarm_sends_notification(self):
|
||||||
@ -2513,7 +2513,7 @@ class TestAlarms(v2.FunctionalTest,
|
|||||||
self.delete('/alarms/%s' % del_alarm_id,
|
self.delete('/alarms/%s' % del_alarm_id,
|
||||||
headers=self.auth_headers, status=204)
|
headers=self.auth_headers, status=204)
|
||||||
get_notifier.assert_called_once_with(mock.ANY,
|
get_notifier.assert_called_once_with(mock.ANY,
|
||||||
publisher_id='ceilometer.api')
|
publisher_id='aodh.api')
|
||||||
calls = notifier.info.call_args_list
|
calls = notifier.info.call_args_list
|
||||||
self.assertEqual(1, len(calls))
|
self.assertEqual(1, len(calls))
|
||||||
args, _ = calls[0]
|
args, _ = calls[0]
|
||||||
@ -2524,7 +2524,7 @@ class TestAlarms(v2.FunctionalTest,
|
|||||||
'project_id', 'timestamp', 'type',
|
'project_id', 'timestamp', 'type',
|
||||||
'user_id']).issubset(payload.keys()))
|
'user_id']).issubset(payload.keys()))
|
||||||
|
|
||||||
@mock.patch('ceilometer.keystone_client.get_client')
|
@mock.patch('aodh.keystone_client.get_client')
|
||||||
def test_post_gnocchi_resources_alarm(self, __):
|
def test_post_gnocchi_resources_alarm(self, __):
|
||||||
json = {
|
json = {
|
||||||
'enabled': False,
|
'enabled': False,
|
||||||
@ -2593,7 +2593,7 @@ class TestAlarms(v2.FunctionalTest,
|
|||||||
self.assertEqual(1, len(alarms))
|
self.assertEqual(1, len(alarms))
|
||||||
self._verify_alarm(json, alarms[0])
|
self._verify_alarm(json, alarms[0])
|
||||||
|
|
||||||
@mock.patch('ceilometer.keystone_client.get_client')
|
@mock.patch('aodh.keystone_client.get_client')
|
||||||
def test_post_gnocchi_metrics_alarm(self, __):
|
def test_post_gnocchi_metrics_alarm(self, __):
|
||||||
json = {
|
json = {
|
||||||
'enabled': False,
|
'enabled': False,
|
||||||
@ -2626,7 +2626,7 @@ class TestAlarms(v2.FunctionalTest,
|
|||||||
self.assertEqual(1, len(alarms))
|
self.assertEqual(1, len(alarms))
|
||||||
self._verify_alarm(json, alarms[0])
|
self._verify_alarm(json, alarms[0])
|
||||||
|
|
||||||
@mock.patch('ceilometer.keystone_client.get_client')
|
@mock.patch('aodh.keystone_client.get_client')
|
||||||
def test_post_gnocchi_aggregation_alarm_project_constraint(self, __):
|
def test_post_gnocchi_aggregation_alarm_project_constraint(self, __):
|
||||||
self.CONF.set_override('gnocchi_url', 'http://localhost:8041',
|
self.CONF.set_override('gnocchi_url', 'http://localhost:8041',
|
||||||
group='alarms')
|
group='alarms')
|
@ -13,7 +13,7 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
"""Test basic ceilometer-api app
|
"""Test basic aodh-api app
|
||||||
"""
|
"""
|
||||||
import json
|
import json
|
||||||
|
|
||||||
@ -21,8 +21,8 @@ import mock
|
|||||||
import six
|
import six
|
||||||
import wsme
|
import wsme
|
||||||
|
|
||||||
from ceilometer import i18n
|
from aodh import i18n
|
||||||
from ceilometer.tests.api import v2
|
from aodh.tests.api import v2
|
||||||
|
|
||||||
|
|
||||||
class TestApiMiddleware(v2.FunctionalTest):
|
class TestApiMiddleware(v2.FunctionalTest):
|
||||||
@ -159,7 +159,7 @@ class TestApiMiddleware(v2.FunctionalTest):
|
|||||||
json.loads(body)['error_message']
|
json.loads(body)['error_message']
|
||||||
['faultstring'])
|
['faultstring'])
|
||||||
|
|
||||||
with mock.patch('ceilometer.api.controllers.'
|
with mock.patch('aodh.api.controllers.'
|
||||||
'v2.base.AlarmNotFound') as CustomErrorClass:
|
'v2.base.AlarmNotFound') as CustomErrorClass:
|
||||||
CustomErrorClass.return_value = wsme.exc.ClientSideError(
|
CustomErrorClass.return_value = wsme.exc.ClientSideError(
|
||||||
"untranslated_error", status_code=404)
|
"untranslated_error", status_code=404)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user