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',
|
flags.DEFINE_string('default_notification_level', 'INFO',
|
||||||
'Default notification level for outgoing notifications')
|
'Default notification level for outgoing notifications')
|
||||||
|
flags.DEFINE_string('default_publisher_id', FLAGS.host,
|
||||||
|
'Default publisher_id for outgoing notifications')
|
||||||
|
|
||||||
|
|
||||||
WARN = 'WARN'
|
WARN = 'WARN'
|
||||||
INFO = 'INFO'
|
INFO = 'INFO'
|
||||||
@ -55,9 +58,9 @@ def notify_decorator(name, fn):
|
|||||||
body['args'].append(arg)
|
body['args'].append(arg)
|
||||||
for key in kwarg:
|
for key in kwarg:
|
||||||
body['kwarg'][key] = kwarg[key]
|
body['kwarg'][key] = kwarg[key]
|
||||||
notify(FLAGS.host,
|
notify(FLAGS.default_publisher_id,
|
||||||
name,
|
name,
|
||||||
DEBUG,
|
FLAGS.default_notification_level,
|
||||||
body)
|
body)
|
||||||
return fn(*args, **kwarg)
|
return fn(*args, **kwarg)
|
||||||
return wrapped_func
|
return wrapped_func
|
||||||
|
@ -141,8 +141,7 @@ class NotifierTestCase(test.TestCase):
|
|||||||
def example_api(arg1, arg2):
|
def example_api(arg1, arg2):
|
||||||
return arg1 + arg2
|
return arg1 + arg2
|
||||||
|
|
||||||
example_api =\
|
example_api = nova.notifier.api.notify_decorator(
|
||||||
nova.notifier.api.notify_decorator(
|
|
||||||
'example_api',
|
'example_api',
|
||||||
example_api)
|
example_api)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user