diff options
author | Scott Moser <smoser@ubuntu.com> | 2015-08-04 22:01:27 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2015-08-04 22:01:27 -0500 |
commit | 5585b397cfb4ba397e9cfba3d86e3d10af20eb71 (patch) | |
tree | 945e0494d57ac1018fc18875b03f8f5c47c0ff4c /cloudinit | |
parent | 02cc30c4ba60050c15c56927fa1bad50299ed8c3 (diff) | |
download | vyos-cloud-init-5585b397cfb4ba397e9cfba3d86e3d10af20eb71.tar.gz vyos-cloud-init-5585b397cfb4ba397e9cfba3d86e3d10af20eb71.zip |
fix pep8
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/reporting/handlers.py | 7 | ||||
-rw-r--r-- | cloudinit/sources/__init__.py | 2 | ||||
-rw-r--r-- | cloudinit/stages.py | 10 |
3 files changed, 7 insertions, 12 deletions
diff --git a/cloudinit/reporting/handlers.py b/cloudinit/reporting/handlers.py index 1d5ca524..be323f53 100644 --- a/cloudinit/reporting/handlers.py +++ b/cloudinit/reporting/handlers.py @@ -21,12 +21,5 @@ class LogHandler(ReportingHandler): logger.info(event.as_string()) -class StderrHandler(ReportingHandler): - def publish_event(self, event): - #sys.stderr.write(event.as_string() + "\n") - print(event.as_string()) - - available_handlers = DictRegistry() available_handlers.register_item('log', LogHandler) -available_handlers.register_item('print', StderrHandler) diff --git a/cloudinit/sources/__init__.py b/cloudinit/sources/__init__.py index cf50c1fb..838cd198 100644 --- a/cloudinit/sources/__init__.py +++ b/cloudinit/sources/__init__.py @@ -257,7 +257,7 @@ def find_source(sys_cfg, distro, paths, ds_deps, cfg_list, pkg_list, reporter): myrep = reporting.ReportEventStack( name="search-%s" % name.replace("DataSource", ""), description="searching for %s data from %s" % (mode, name), - message = "no %s data found from %s" % (mode, name), + message="no %s data found from %s" % (mode, name), parent=reporter) try: with myrep: diff --git a/cloudinit/stages.py b/cloudinit/stages.py index 7b489b9f..d300709d 100644 --- a/cloudinit/stages.py +++ b/cloudinit/stages.py @@ -243,7 +243,8 @@ class Init(object): return self.datasource with reporting.ReportEventStack( - name="check-cache", description="attempting to read from cache", + name="check-cache", + description="attempting to read from cache", parent=self.reporter) as myrep: ds = self._restore_from_cache() if ds: @@ -708,17 +709,18 @@ class Modules(object): # This name will affect the semaphore name created run_name = "config-%s" % (name) - desc="running %s with frequency %s" % (run_name, freq) + desc = "running %s with frequency %s" % (run_name, freq) myrep = reporting.ReportEventStack( name=run_name, description=desc, parent=self.reporter) with myrep: - ran, _r = cc.run(run_name, mod.handle, func_args, freq=freq) + ran, _r = cc.run(run_name, mod.handle, func_args, + freq=freq) if ran: myrep.message = "%s ran successfully" % run_name else: myrep.message = "%s previously ran" % run_name - + except Exception as e: util.logexc(LOG, "Running module %s (%s) failed", name, mod) failures.append((name, e)) |