diff options
author | Joshua Harlow <harlowja@gmail.com> | 2013-07-21 10:45:29 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@gmail.com> | 2013-07-21 10:45:29 -0700 |
commit | 971c2b2366c6e58921e1d2dd3ba18e597cbc20e8 (patch) | |
tree | a1169ea5937ea9543e4a7e9b26a5d27479ad5a97 /cloudinit/stages.py | |
parent | bbfc76fb74595881b25acc1bbbd426314c2390ed (diff) | |
download | vyos-cloud-init-971c2b2366c6e58921e1d2dd3ba18e597cbc20e8.tar.gz vyos-cloud-init-971c2b2366c6e58921e1d2dd3ba18e597cbc20e8.zip |
Just use an initialized array.
Diffstat (limited to 'cloudinit/stages.py')
-rw-r--r-- | cloudinit/stages.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/cloudinit/stages.py b/cloudinit/stages.py index ba974a3e..fade1182 100644 --- a/cloudinit/stages.py +++ b/cloudinit/stages.py @@ -386,12 +386,12 @@ class Init(object): def init_handlers(): # Init the handlers first for (_ctype, mod) in c_handlers.iteritems(): - if 'initialized' in c_handlers.markings[mod]: + if mod in c_handlers.initialized: # Avoid initing the same module twice (if said module # is registered to more than one content-type). continue handlers.call_begin(mod, data, frequency) - c_handlers.markings[mod].append('initialized') + c_handlers.initialized.append(mod) def walk_handlers(): # Walk the user data @@ -413,16 +413,11 @@ class Init(object): def finalize_handlers(): # Give callbacks opportunity to finalize for (_ctype, mod) in c_handlers.iteritems(): - mod_markings = c_handlers.markings[mod] - if 'initialized' not in mod_markings: + if mod not in c_handlers.initialized: # Said module was never inited in the first place, so lets # not attempt to finalize those that never got called. continue - if 'finalized' in mod_markings: - # Avoid finalizing the same module twice (if said module - # is registered to more than one content-type). - continue - c_handlers.markings[mod].append('finalized') + c_handlers.initialized.remove(mod) try: handlers.call_end(mod, data, frequency) except: |