From 005ff658c6f301303269e14dfef4c27ada5c3982 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Sat, 16 Jun 2012 20:16:26 -0700 Subject: 1. Ensure a that when a bad version is found, that it gets set to 1. 2. Increment part handler count even if it doesn't get registered (this shouldn't cause any problems) --- cloudinit/handlers/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cloudinit/handlers/__init__.py') diff --git a/cloudinit/handlers/__init__.py b/cloudinit/handlers/__init__.py index 156e228d..0ef704f7 100644 --- a/cloudinit/handlers/__init__.py +++ b/cloudinit/handlers/__init__.py @@ -102,7 +102,7 @@ def run_part(mod, data, ctype, filename, payload, frequency): try: mod_ver = int(mod_ver) except: - mod_ver = None + mod_ver = 1 try: if mod_ver and mod_ver >= 2: # Treat as v. 2 which does get a frequency @@ -134,12 +134,12 @@ def walker_handle_handler(pdata, _ctype, _filename, payload): modfname = "%s.py" % (modfname) # TODO: Check if path exists?? util.write_file(modfname, payload, 0600) + pdata['handlercount'] = curcount + 1 handlers = pdata['handlers'] try: mod = fixup_handler(importer.import_module(modname)) handlers.register(mod) call_begin(mod, pdata['data'], frequency) - pdata['handlercount'] = curcount + 1 except: util.logexc(LOG, "Failed at registered python file: %s", modfname) -- cgit v1.2.3