Make input func monitor support attribute categories. Resolve #3307
This commit is contained in:
parent
af896b385a
commit
62ff667f9a
3 changed files with 6 additions and 1 deletions
|
|
@ -153,7 +153,7 @@ class MonitorHandler(object):
|
|||
"""
|
||||
if not fieldname.startswith("db_") or not hasattr(obj, fieldname):
|
||||
# an Attribute - we track its db_value field
|
||||
obj = obj.attributes.get(fieldname, return_obj=True)
|
||||
obj = obj.attributes.get(fieldname, category=category, return_obj=True)
|
||||
if not obj:
|
||||
return
|
||||
fieldname = self._attr_category_fieldname("db_value", category)
|
||||
|
|
|
|||
|
|
@ -445,6 +445,7 @@ def monitor(session, *args, **kwargs):
|
|||
|
||||
name = kwargs.get("name", None)
|
||||
outputfunc_name = kwargs("outputfunc_name", "monitor")
|
||||
category = kwargs.get("category", None)
|
||||
if name and name in _monitorable and session.puppet:
|
||||
field_name = _monitorable[name]
|
||||
obj = session.puppet
|
||||
|
|
@ -461,6 +462,7 @@ def monitor(session, *args, **kwargs):
|
|||
name=name,
|
||||
session=session,
|
||||
outputfunc_name=outputfunc_name,
|
||||
category=category,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue