Fixed some docstring
Added default publisher_id flagw
This commit is contained in:
parent
c79a963009
commit
11a9d4acc3
@ -25,6 +25,9 @@ FLAGS = flags.FLAGS
|
||||
|
||||
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')
|
||||
|
||||
|
||||
WARN = 'WARN'
|
||||
INFO = 'INFO'
|
||||
@ -55,9 +58,9 @@ def notify_decorator(name, fn):
|
||||
body['args'].append(arg)
|
||||
for key in kwarg:
|
||||
body['kwarg'][key] = kwarg[key]
|
||||
notify(FLAGS.host,
|
||||
notify(FLAGS.default_publisher_id,
|
||||
name,
|
||||
DEBUG,
|
||||
FLAGS.default_notification_level,
|
||||
body)
|
||||
return fn(*args, **kwarg)
|
||||
return wrapped_func
|
||||
|
@ -141,8 +141,7 @@ class NotifierTestCase(test.TestCase):
|
||||
def example_api(arg1, arg2):
|
||||
return arg1 + arg2
|
||||
|
||||
example_api =\
|
||||
nova.notifier.api.notify_decorator(
|
||||
example_api = nova.notifier.api.notify_decorator(
|
||||
'example_api',
|
||||
example_api)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user