summaryrefslogtreecommitdiff
path: root/cloudinit/log.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-03-11 21:15:45 +0100
committerGitHub <noreply@github.com>2020-03-11 21:15:45 +0100
commitfd87c24ff8f6f09a7e2cc223a4e8cdb8c08f1ef8 (patch)
treeb754b3991e5e57a9ae9155819f73fa0cbd4be269 /cloudinit/log.py
parentca9a4eb26b41c204d1bd3a15586b14a5dde950bb (diff)
parentc6627bc05a57645e6af8b9a5a67e452d9f37e487 (diff)
downloadvyos-cloud-init-fd87c24ff8f6f09a7e2cc223a4e8cdb8c08f1ef8.tar.gz
vyos-cloud-init-fd87c24ff8f6f09a7e2cc223a4e8cdb8c08f1ef8.zip
Merge pull request #4 from zdc/T2117
Cloud-init: T2117: Updated to 20.1 version
Diffstat (limited to 'cloudinit/log.py')
-rw-r--r--cloudinit/log.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/cloudinit/log.py b/cloudinit/log.py
index 5ae312ba..827db12b 100644
--- a/cloudinit/log.py
+++ b/cloudinit/log.py
@@ -8,17 +8,13 @@
#
# This file is part of cloud-init. See LICENSE file for license information.
+import collections
+import io
import logging
import logging.config
import logging.handlers
-
-import collections
import os
import sys
-
-import six
-from six import StringIO
-
import time
# Logging levels for easy access
@@ -74,13 +70,13 @@ def setupLogging(cfg=None):
log_cfgs = []
log_cfg = cfg.get('logcfg')
- if log_cfg and isinstance(log_cfg, six.string_types):
+ if log_cfg and isinstance(log_cfg, str):
# 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, six.string_types):
+ if isinstance(a_cfg, str):
log_cfgs.append(a_cfg)
elif isinstance(a_cfg, (collections.Iterable)):
cfg_str = [str(c) for c in a_cfg]
@@ -100,7 +96,7 @@ def setupLogging(cfg=None):
# is acting as a file)
pass
else:
- log_cfg = StringIO(log_cfg)
+ log_cfg = io.StringIO(log_cfg)
# Attempt to load its config
logging.config.fileConfig(log_cfg)
# The first one to work wins!