PaloAltoNetworks/SafeNetworking

Port to ELK 7.x causes ValueError thrown if Domain doc doesn't exist

punisherVX opened this issue · 2 comments

The get() method on the Document class no longer returns an HTTP 404, but rather throws an exception that an empty value is passed.

/home/earcuri/_dev/safe-networking/project/dns/dnsutils.py(480)getDomainDoc()
-> domainDoc = DomainDetailsDoc.get(id=domainName)
(Pdb) ValueError: Empty value passed for a required argument.

zube commented

sdndude said: This is actually a new "feature" (I won't get into it) where the elasticsearch-dsl changed the Meta class to Index class (while using name, instead of index as the set field) so the DomainDocument class no longer knew which index it was using.

Fixed by changing:

class Meta:
        index = 'sfn-domain-details'

To:

class Index:
        name = 'sfn-domain-details'
zube commented

sdndude said: This is fixed in 33d1e6c