PaloAltoNetworks / SafeNetworking

Read only mirror. To contribute or submit issues, please go to the website link --->
https://gitlab.com/panw-gse/as/SafeNetworking/
Apache License 2.0
12 stars 10 forks source link

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

Closed punisherVX closed 5 years ago

punisherVX commented 5 years ago

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[bot] commented 5 years ago

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[bot] commented 5 years ago

sdndude said: This is fixed in 33d1e6c