From eae3b6ad499b88b725a52cf07245e4721af380cf Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Sat, 20 Jul 2013 07:37:02 -0700 Subject: Ensure we remove the same way we detect. --- cloudinit/handlers/cloud_config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cloudinit') diff --git a/cloudinit/handlers/cloud_config.py b/cloudinit/handlers/cloud_config.py index 654314c0..4dcdbe8b 100644 --- a/cloudinit/handlers/cloud_config.py +++ b/cloudinit/handlers/cloud_config.py @@ -114,7 +114,8 @@ class CloudConfigPartHandler(handlers.Handler): return (payload_yaml, all_mergers) def _merge_patch(self, payload): - if payload.startswith("#json-patch"): + payload = payload.lstrip() + if payload.lower().startswith("#json-patch"): # JSON doesn't handle comments in this manner, so ensure that # if we started with this 'type' that we remove it before # attempting to load it as json (which the jsonpatch library will -- cgit v1.2.3