diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-16 23:15:05 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-16 23:15:05 -0700 |
commit | f90d81a118cc119cba7130b30f71ac1f0d0f409e (patch) | |
tree | 85dfa1ef1e63eb15b5fdb2332018ab999437aedb /cloudinit/handlers | |
parent | 23bb80b3ae52836e2021d326d8b63d3230e06e52 (diff) | |
download | vyos-cloud-init-f90d81a118cc119cba7130b30f71ac1f0d0f409e.tar.gz vyos-cloud-init-f90d81a118cc119cba7130b30f71ac1f0d0f409e.zip |
1. Allow for checking against lower case include types.
2. Perform lstrip on the payload, just incase people put spaces/whitespace before the type.
Diffstat (limited to 'cloudinit/handlers')
-rw-r--r-- | cloudinit/handlers/__init__.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cloudinit/handlers/__init__.py b/cloudinit/handlers/__init__.py index 3944c661..d3374666 100644 --- a/cloudinit/handlers/__init__.py +++ b/cloudinit/handlers/__init__.py @@ -218,8 +218,10 @@ def fixup_handler(mod, def_freq=PER_INSTANCE): def type_from_starts_with(payload, default=None): + payload_lc = payload.lower() + payload_lc = payload_lc.lstrip() for text in INCLUSION_SRCH: - if payload.startswith(text): + if payload_lc.startswith(text): return INCLUSION_TYPES_MAP[text] return default |