Add support for MSDP LIST/REPORT/UNREPORT. Resolves #1507.
This commit is contained in:
parent
7bf4874f7e
commit
fccb128952
4 changed files with 110 additions and 25 deletions
|
|
@ -172,16 +172,21 @@ class MonitorHandler(object):
|
|||
"""
|
||||
self.monitors = defaultdict(lambda: defaultdict(dict))
|
||||
|
||||
def all(self):
|
||||
def all(self, obj=None):
|
||||
"""
|
||||
List all monitors.
|
||||
List all monitors or all monitors of a given object.
|
||||
|
||||
Args:
|
||||
obj (Object): The object on which to list all monitors.
|
||||
|
||||
Returns:
|
||||
monitors (list): The handled monitors.
|
||||
|
||||
"""
|
||||
output = []
|
||||
for obj in self.monitors:
|
||||
objs = [obj] if obj else self.monitors
|
||||
|
||||
for obj in objs:
|
||||
for fieldname in self.monitors[obj]:
|
||||
for idstring, (callback, persistent, kwargs) in self.monitors[obj][fieldname].items():
|
||||
output.append((obj, fieldname, idstring, persistent, kwargs))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue