summaryrefslogtreecommitdiff
path: root/cloudinit/handlers
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@gmail.com>2013-07-23 11:57:25 -0400
committerScott Moser <smoser@ubuntu.com>2013-07-23 11:57:25 -0400
commita8d2b2f8d7b9315d729873b15ed8dedb9c1b069f (patch)
treeca67cdb7f131382746353fae8eebfb2e00b50f5b /cloudinit/handlers
parentd66973bc6850b18b7ad69341e5b626919d8606f5 (diff)
parentd655d019fb0a45389d87db39b0ef5001e27e2616 (diff)
downloadvyos-cloud-init-a8d2b2f8d7b9315d729873b15ed8dedb9c1b069f.tar.gz
vyos-cloud-init-a8d2b2f8d7b9315d729873b15ed8dedb9c1b069f.zip
finalize handlers even when another handler fails.
Instead of previously initializing and not finalizing the handles that completed successfully when a handler initializing or running failed we should attempt to always give said handlers a chance to finalize (even when another handler fails). LP: #1203368
Diffstat (limited to 'cloudinit/handlers')
-rw-r--r--cloudinit/handlers/__init__.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/cloudinit/handlers/__init__.py b/cloudinit/handlers/__init__.py
index 497d68c5..1d450061 100644
--- a/cloudinit/handlers/__init__.py
+++ b/cloudinit/handlers/__init__.py
@@ -151,10 +151,9 @@ def walker_handle_handler(pdata, _ctype, _filename, payload):
try:
mod = fixup_handler(importer.import_module(modname))
call_begin(mod, pdata['data'], frequency)
- # Only register and increment
- # after the above have worked (so we don't if it
- # fails)
- handlers.register(mod)
+ # Only register and increment after the above have worked, so we don't
+ # register if it fails starting.
+ handlers.register(mod, initialized=True)
pdata['handlercount'] = curcount + 1
except:
util.logexc(LOG, "Failed at registering python file: %s (part "