summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-07-10 16:13:34 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-07-10 16:13:34 -0700
commit86f0d708564ab210f2f58f3e76f94a4af56e360b (patch)
treee509e36d1527c422a22ef030c7134e82f786ac1a /cloudinit
parent02fe9d1f85d1194e631c4992495086ce7733f6e1 (diff)
downloadvyos-cloud-init-86f0d708564ab210f2f58f3e76f94a4af56e360b.tar.gz
vyos-cloud-init-86f0d708564ab210f2f58f3e76f94a4af56e360b.zip
Remove the usage of set,list,dict and use the collections
iterable which performs the same, but can handle iterator types beyond those three.
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/log.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/cloudinit/log.py b/cloudinit/log.py
index 5fb4ae16..819c85b6 100644
--- a/cloudinit/log.py
+++ b/cloudinit/log.py
@@ -24,6 +24,7 @@ import logging
import logging.handlers
import logging.config
+import collections
import os
import sys
@@ -63,9 +64,11 @@ def setupLogging(cfg=None):
# 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 and isinstance(cfg['log_cfgs'], (set, list)):
+ elif "log_cfgs" in cfg:
for a_cfg in cfg['log_cfgs']:
- if isinstance(a_cfg, (list, set, dict)):
+ if isinstance(a_cfg, (basestring, str)):
+ log_cfgs.append(a_cfg)
+ elif isinstance(a_cfg, (collections.Iterable)):
cfg_str = [str(c) for c in a_cfg]
log_cfgs.append('\n'.join(cfg_str))
else: