From 86f0d708564ab210f2f58f3e76f94a4af56e360b Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Tue, 10 Jul 2012 16:13:34 -0700 Subject: Remove the usage of set,list,dict and use the collections iterable which performs the same, but can handle iterator types beyond those three. --- cloudinit/log.py | 7 +++++-- 1 file 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: -- cgit v1.2.3