Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some tweeks needed to run cbc-syslog 1.0.2 with Python 3.6 (CentOS) #44

Closed
haromatsu opened this issue Jul 21, 2020 · 1 comment
Closed

Comments

@haromatsu
Copy link

haromatsu commented Jul 21, 2020

When I installed cbc-syslog 1.0.2 on CentOS with python3.6, I get following error when testing:

# /usr/bin/python3.6 /usr/local/lib/python3.6/site-packages/cbc_syslog/cb_defense_syslog.py --config-file /usr/local/lib/python3.6/site-packages/cbc_syslog/root/etc/cb/integrations/cb-defense-syslog/cb-defense-syslog.conf --log-file /var/log/cb/integrations/cb-defense-syslog/cb-defense-syslog.log
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/cbc_syslog/cb_defense_syslog.py", line 5, in <module>
    import ConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
#

I needed following fix to make it run:

# diff -u /usr/local/lib/python3.6/site-packages/cbc_syslog/cb_defense_syslog.py.orig /usr/local/lib/python3.6/site-packages/cbc_syslog/cb_defense_syslog.py
--- /usr/local/lib/python3.6/site-packages/cbc_syslog/cb_defense_syslog.py.orig 2020-07-21 16:20:57.418225523 +0900
+++ /usr/local/lib/python3.6/site-packages/cbc_syslog/cb_defense_syslog.py      2020-07-21 16:21:22.824624882 +0900
@@ -2,7 +2,7 @@
 import ssl
 import sys
 import argparse
-import ConfigParser
+import configparser
 import requests
 from jinja2 import Template
 import os
@@ -35,7 +35,7 @@
     """
     global config
     try:
-        config = ConfigParser.ConfigParser()
+        config = configparser.ConfigParser()
         config.readfp(open(args.config_file))
     except Exception as e:
         logging.error(e, exc_info=True)
@avanbrunt-cb
Copy link
Contributor

At the moment the script doesn't directly support python3 I am looking into adding using six.py to fix this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants