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/helpers.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/helpers.py')
-rw-r--r-- | cloudinit/helpers.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cloudinit/helpers.py b/cloudinit/helpers.py index bd37b8a3..1c46efde 100644 --- a/cloudinit/helpers.py +++ b/cloudinit/helpers.py @@ -22,7 +22,6 @@ from time import time -import collections import contextlib import io import os @@ -282,7 +281,7 @@ class ContentHandlers(object): def __init__(self): self.registered = {} - self.markings = collections.defaultdict(list) + self.initialized = [] def __contains__(self, item): return self.is_registered(item) @@ -293,11 +292,13 @@ class ContentHandlers(object): def is_registered(self, content_type): return content_type in self.registered - def register(self, mod): + def register(self, mod, initialized=False): types = set() for t in mod.list_types(): self.registered[t] = mod types.add(t) + if initialized and mod not in self.initialized: + self.initialized.append(mod) return types def _get_handler(self, content_type): |