summaryrefslogtreecommitdiff
path: root/cloudinit/log.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2015-01-21 17:56:53 -0500
committerBarry Warsaw <barry@python.org>2015-01-21 17:56:53 -0500
commitf895cb12141281702b34da18f2384deb64c881e7 (patch)
tree7a7433752ba1317c370dd3dd815c9ee7331a923b /cloudinit/log.py
parenta64bb4febc79fcf641f6471d8cc00c74ca915f3d (diff)
downloadvyos-cloud-init-f895cb12141281702b34da18f2384deb64c881e7.tar.gz
vyos-cloud-init-f895cb12141281702b34da18f2384deb64c881e7.zip
Largely merge lp:~harlowja/cloud-init/py2-3 albeit manually because it seemed
to be behind trunk. `tox -e py27` passes full test suite. Now to work on replacing mocker.
Diffstat (limited to 'cloudinit/log.py')
-rw-r--r--cloudinit/log.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/cloudinit/log.py b/cloudinit/log.py
index 622c946c..3c79b9c9 100644
--- a/cloudinit/log.py
+++ b/cloudinit/log.py
@@ -28,7 +28,8 @@ import collections
import os
import sys
-from StringIO import StringIO
+import six
+from six import StringIO
# Logging levels for easy access
CRITICAL = logging.CRITICAL
@@ -72,13 +73,13 @@ def setupLogging(cfg=None):
log_cfgs = []
log_cfg = cfg.get('logcfg')
- if log_cfg and isinstance(log_cfg, (str, basestring)):
+ if log_cfg and isinstance(log_cfg, six.string_types):
# If there is a 'logcfg' entry in the config,
# respect it, it is the old keyname
log_cfgs.append(str(log_cfg))
elif "log_cfgs" in cfg:
for a_cfg in cfg['log_cfgs']:
- if isinstance(a_cfg, (basestring, str)):
+ if isinstance(a_cfg, six.string_types):
log_cfgs.append(a_cfg)
elif isinstance(a_cfg, (collections.Iterable)):
cfg_str = [str(c) for c in a_cfg]