summaryrefslogtreecommitdiff
path: root/cloudinit/log.py
AgeCommit message (Collapse)Author
2021-12-15Adopt Black and isort (SC-700) (#1157)James Falcon
Applied Black and isort, fixed any linting issues, updated tox.ini and CI.
2021-06-15Replace deprecated collections.Iterable with abc replacement (#922)James Falcon
LP: #1932048
2020-04-23log: remove unnecessary import fallback logic (#327)Daniel Watkins
logging.NullHandler has been present since Python 3.1, we don't need to handle its absence.
2020-01-21Start removing dependency on six (#178)Daniel Watkins
* url_helper: drop six * url_helper: sort imports * log: drop six * log: sort imports * handlers/__init__: drop six * handlers/__init__: sort imports * user_data: drop six * user_data: sort imports * sources/__init__: drop six * sources/__init__: sort imports * DataSourceOVF: drop six * DataSourceOVF: sort imports * sources/helpers/openstack: drop six * sources/helpers/openstack: sort imports * mergers/m_str: drop six This also allowed simplification of the logic, as we will never encounter a non-string text type. * type_utils: drop six * mergers/m_dict: drop six * mergers/m_list: drop six * cmd/query: drop six * mergers/__init__: drop six * net/cmdline: drop six * reporting/handlers: drop six * reporting/handlers: sort imports
2018-09-11user-data: jinja template to render instance-data.json in cloud-configChad Smith
Allow users to provide '## template: jinja' as the first line or their #cloud-config or custom script user-data parts. When this header exists, the cloud-config or script will be rendered as a jinja template. All instance metadata keys and values present in /run/cloud-init/instance-data.json will be available as jinja variables for the template. This means any cloud-config module or script can reference any standardized instance data in templates and scripts. Additionally, any standardized instance-data.json keys scoped below a '<v#>' key will be promoted as a top-level key for ease of reference in templates. This means that '{{ local_hostname }}' is the same as using the latest '{{ v#.local_hostname }}'. Since instance-data is written to /run/cloud-init/instance-data.json, make sure it is persisted across reboots when the cached datasource opject is reloaded. LP: #1791781
2017-08-25Configure logging module to always use UTC time.Ryan Harper
Currently the python logging module will default to a local time which may contain an TZ offset in the values it produces, but the logged time format does not contain the offset. Switching to UTC time for logging produces consistent values in the cloud-init.log file and avoids issues when the timezone is changed during boot. LP: #1713158
2016-12-22LICENSE: Allow dual licensing GPL-3 or Apache 2.0Jon Grimm
This has been a recurring ask and we had initially just made the change to the cloud-init 2.0 codebase. As the current thinking is we'll just continue to enhance the current codebase, its desirable to relicense to match what we'd intended as part of the 2.0 plan here. - put a brief description of license in LICENSE file - put full license versions in LICENSE-GPLv3 and LICENSE-Apache2.0 - simplify the per-file header to reference LICENSE - tox: ignore H102 (Apache License Header check) Add license header to files that ship. Reformat headers, make sure everything has vi: at end of file. Non-shipping files do not need the copyright header, but at the moment tests/ have it.
2015-01-21Largely merge lp:~harlowja/cloud-init/py2-3 albeit manually because it seemedBarry Warsaw
to be behind trunk. `tox -e py27` passes full test suite. Now to work on replacing mocker.
2013-04-17add debug output to ccfg-merge-debugScott Moser
Exeptions were being swallowed completely and no way to even see them other than log.
2012-10-16Move the recursive flushing to the log module.Joshua Harlow
2012-08-22fix pep8 complaints.Scott Moser
make pep8 now is silent on precise's pep8 ( 0.6.1-2ubuntu2).
2012-07-10Remove the usage of set,list,dict and use the collectionsJoshua Harlow
iterable which performs the same, but can handle iterator types beyond those three.
2012-07-10fix regression in logging codeScott Moser
revno 584 broke logging. This fixes as it intended.
2012-07-09Add more information about why we are returning early andJoshua Harlow
why we don't convert a string that is a filename to a string buffer/io like object.
2012-07-09do not warn to stderr if one of the logging configs works.Scott Moser
In 0.6.3, if one of the logging configs succeeded, then it was just used. If it failed, it failed silently. This behavior was expected, and desired. As the code was here, we tried each log_cfg in the list anyway (possibly using the last rather than the first) and writing a messgae including 'WARN' to stderr on failure of the log.
2012-06-20Massive pylint + pep8 fixups!Joshua Harlow
2012-06-181. Simplify basic logging (which will not always be turned on in the new ↵Joshua Harlow
cloud init main entrypoint 2. Have the ability to reset the logging handlers a. This seems needed when we initially have basic logging turned on, then later we come in and change the logging. It seems required for some odd reason to go in and reset the handlers for the root/cloudinit loggers (needs some more investigation).
2012-06-15Fixups to ensure that pylint does not find anything major wrong.Joshua Harlow
2012-06-15Ensure that the root logger is manipulated instead of just the cloudinit ↵Joshua Harlow
logger, show how many configs were tried if none succeeded, and for basic logging setup try to mirror more of what is in the default configuration file if all else fails
2012-06-11Added log setup and a basic log (for when one is not enabled)Joshua Harlow
2012-06-09Add copyright.Joshua Harlow
2012-06-08Working on making this have the old setup (where strings are taken in for ↵Joshua Harlow
config) as well as file names (for those that have files).
2012-06-071. Adding some new helper files that split off file inclusion, templating, ↵Joshua Harlow
importing, constant usage. 1. Move all datasources to a new sources directory 1. Rename some files to be more consistent with python file/module naming.