diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-07-09 20:16:54 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-07-09 20:16:54 -0700 |
commit | a83727242a1a6f044adfab39e6cf6466f0719259 (patch) | |
tree | 8ce639498992abcde17e3b561b1a558870e065ff /cloudinit/log.py | |
parent | 4b8d66b68ffc9a5cfa8fa8d129f9eed55f6ac1a7 (diff) | |
download | vyos-cloud-init-a83727242a1a6f044adfab39e6cf6466f0719259.tar.gz vyos-cloud-init-a83727242a1a6f044adfab39e6cf6466f0719259.zip |
Add more information about why we are returning early and
why we don't convert a string that is a filename to a string
buffer/io like object.
Diffstat (limited to 'cloudinit/log.py')
-rw-r--r-- | cloudinit/log.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cloudinit/log.py b/cloudinit/log.py index 76a2c5e0..0c6938d6 100644 --- a/cloudinit/log.py +++ b/cloudinit/log.py @@ -78,17 +78,21 @@ def setupLogging(cfg=None): am_tried += 1 # Assume its just a string if not a filename if log_cfg.startswith("/") and os.path.isfile(log_cfg): + # Leave it as a file and do not make it look like + # something that is a file (but is really a buffer that + # is acting as a file) pass else: log_cfg = StringIO(log_cfg) # Attempt to load its config logging.config.fileConfig(log_cfg) + # The first one to work wins! return except Exception: - # we do not write any logs of this here, because the default + # We do not write any logs of this here, because the default # configuration includes an attempt at using /dev/log, followed # up by writing to a file. /dev/log will not exist in very early - # boot, so an exception on that is expected. + # boot, so an exception on that is expected. pass # If it didn't work, at least setup a basic logger (if desired) |