Merge branch 'python2' into 'main'

fix: support python2 fail2ban

Closes #14

See merge request hectorjsmith/fail2ban-prometheus-exporter!48
This commit is contained in:
Hector 2021-12-18 06:58:40 +00:00
commit 4be463a7c8

View File

@ -59,7 +59,7 @@ func (s *Fail2BanSocket) read() (interface{}, error) {
unpickler := pickle.NewUnpickler(bufReader) unpickler := pickle.NewUnpickler(bufReader)
unpickler.FindClass = func(module, name string) (interface{}, error) { unpickler.FindClass = func(module, name string) (interface{}, error) {
if module == "builtins" && name == "str" { if (module == "builtins" || module == "__builtin__") && name == "str" {
return &Py_builtins_str{}, nil return &Py_builtins_str{}, nil
} }
return nil, fmt.Errorf("class not found: " + module + " : " + name) return nil, fmt.Errorf("class not found: " + module + " : " + name)