Skip to content

Commit

Permalink
Merge branch 'icinga-db-py3' of https://github.com/imrejonk/debops in…
Browse files Browse the repository at this point in the history
…to imrejonk-icinga-db-py3
  • Loading branch information
drybjed committed Sep 20, 2019
2 parents eb188ee + 6ed463c commit 16d42d7
Showing 1 changed file with 12 additions and 1 deletion.
Expand Up @@ -12,6 +12,12 @@ try:
except ImportError:
from ConfigParser import ConfigParser

# Python 2 compatibility
try:
from StringIO import StringIO
except ImportError:
pass


def get_config(config_file):
config_data = []
Expand All @@ -22,7 +28,12 @@ def get_config(config_file):
try:
config.read_string(config_string.decode('utf-8'))
except AttributeError:
config.read_string(config_string)
try:
config.read_string(config_string)
except AttributeError:
# Python 2 compatibility
sbuffer = StringIO(config_string)
config.readfp(sbuffer)

for section in config.sections():

Expand Down

0 comments on commit 16d42d7

Please sign in to comment.