summaryrefslogtreecommitdiff
path: root/cloudinit/handlers/__init__.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2014-01-16 16:57:21 -0500
committerScott Moser <smoser@ubuntu.com>2014-01-16 16:57:21 -0500
commit8209b21fc29c7d8585b8925a4deb929639797f9b (patch)
tree52e4a031104bb95fb24710e4ad3b406be47916c2 /cloudinit/handlers/__init__.py
parent8a952c7c7797e2a1dfcd2be1c3a983de767de04e (diff)
downloadvyos-cloud-init-8209b21fc29c7d8585b8925a4deb929639797f9b.tar.gz
vyos-cloud-init-8209b21fc29c7d8585b8925a4deb929639797f9b.zip
simplify consume_vendordata, move exclusion, consume_vendordata per instance
this simplifies consume_vendordata a bit, changes consume_vendordata to be by default "PER_INSTANCE" (like userdata). The other thing we do here is move the exlusion to be handled when walking the data. The benefit of doing it then is that we can exclude part-handlers. Without the ability to exlude part handlers, exclusion is basically useless (since part-handlers could accomplish anything they wanted).
Diffstat (limited to 'cloudinit/handlers/__init__.py')
-rw-r--r--cloudinit/handlers/__init__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/cloudinit/handlers/__init__.py b/cloudinit/handlers/__init__.py
index 2ddc75f4..059d7495 100644
--- a/cloudinit/handlers/__init__.py
+++ b/cloudinit/handlers/__init__.py
@@ -187,6 +187,10 @@ def _escape_string(text):
def walker_callback(data, filename, payload, headers):
content_type = headers['Content-Type']
+ if content_type in data.get('excluded'):
+ LOG.debug('content_type "%s" is excluded', content_type)
+ return
+
if content_type in PART_CONTENT_TYPES:
walker_handle_handler(data, content_type, filename, payload)
return