diff options
Diffstat (limited to 'nova/notifier')
| -rw-r--r-- | nova/notifier/api.py | 18 | ||||
| -rw-r--r-- | nova/notifier/list_notifier.py | 10 | ||||
| -rw-r--r-- | nova/notifier/rabbit_notifier.py | 10 |
3 files changed, 26 insertions, 12 deletions
diff --git a/nova/notifier/api.py b/nova/notifier/api.py index 043838536..50730cb0f 100644 --- a/nova/notifier/api.py +++ b/nova/notifier/api.py @@ -15,19 +15,25 @@ import uuid +from nova.common import cfg from nova import flags from nova import utils from nova import log as logging -LOG = logging.getLogger('nova.exception') -FLAGS = flags.FLAGS +LOG = logging.getLogger('nova.exception') -flags.DEFINE_string('default_notification_level', 'INFO', - 'Default notification level for outgoing notifications') -flags.DEFINE_string('default_publisher_id', FLAGS.host, - 'Default publisher_id for outgoing notifications') +notifier_opts = [ + cfg.StrOpt('default_notification_level', + default='INFO', + help='Default notification level for outgoing notifications'), + cfg.StrOpt('default_publisher_id', + default='$host', + help='Default publisher_id for outgoing notifications'), + ] +FLAGS = flags.FLAGS +FLAGS.add_options(notifier_opts) WARN = 'WARN' INFO = 'INFO' diff --git a/nova/notifier/list_notifier.py b/nova/notifier/list_notifier.py index 62847c85f..29c6ba720 100644 --- a/nova/notifier/list_notifier.py +++ b/nova/notifier/list_notifier.py @@ -13,16 +13,20 @@ # License for the specific language governing permissions and limitations # under the License. +from nova.common import cfg from nova import flags from nova import log as logging from nova import utils from nova.exception import ClassNotFound -flags.DEFINE_multistring('list_notifier_drivers', - ['nova.notifier.no_op_notifier'], - 'List of drivers to send notifications') + +list_notifier_drivers_opt = \ + cfg.MultiStrOpt('list_notifier_drivers', + default=['nova.notifier.no_op_notifier'], + help='List of drivers to send notifications') FLAGS = flags.FLAGS +FLAGS.add_option(list_notifier_drivers_opt) LOG = logging.getLogger('nova.notifier.list_notifier') diff --git a/nova/notifier/rabbit_notifier.py b/nova/notifier/rabbit_notifier.py index 64e03697a..c88f76cb0 100644 --- a/nova/notifier/rabbit_notifier.py +++ b/nova/notifier/rabbit_notifier.py @@ -16,14 +16,18 @@ import nova.context +from nova.common import cfg from nova import flags from nova import rpc -FLAGS = flags.FLAGS +notification_topic_opt = \ + cfg.StrOpt('notification_topic', + default='notifications', + help='RabbitMQ topic used for Nova notifications') -flags.DEFINE_string('notification_topic', 'notifications', - 'RabbitMQ topic used for Nova notifications') +FLAGS = flags.FLAGS +FLAGS.add_option(notification_topic_opt) def notify(message): |
