Skip to content

Commit 2207c38

Browse files
Merge pull request #4754 from zenoss/bugfix/ZEN-35572
Ensure device name is valid before using it in a Solr query.
2 parents 06fa8e8 + 6f431bc commit 2207c38

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • src/Products/Zuul/routers

src/Products/Zuul/routers/zep.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from Products.ZenUtils.extdirect.router import DirectResponse
3131
from Products.Zuul.decorators import require, serviceConnectionError
3232
from Products.ZenUtils.guid.interfaces import IGlobalIdentifier, IGUIDManager
33+
from Products.ZenUtils.Utils import prepId
3334
from Products.ZenUtils.virtual_root import IVirtualRoot
3435
from Products.ZenEvents.EventClass import EventClass
3536
from Products.ZenMessaging.audit import audit
@@ -673,7 +674,8 @@ def manage_events(self, evids=None, excludeIds=None, params=None, uid=None, asof
673674

674675
def can_add_events(self, summary, device, component, severity, evclasskey,
675676
evclass=None, monitor=None, **kwargs):
676-
ctx = self.context.dmd.Devices.findDevice(device.strip())
677+
device = prepId(device)
678+
ctx = self.context.dmd.Devices.findDevice(device)
677679
if not ctx:
678680
ctx = self.context
679681

0 commit comments

Comments
 (0)