From c23ade677e59e67d4d84ee111e337a99d11271e2 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Sat, 16 Jun 2012 09:32:22 -0700 Subject: 1. Change to fixup transform/form transform name 2. Check lowercase name against .py instead of unknown case. --- cloudinit/transforms/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cloudinit/transforms/__init__.py b/cloudinit/transforms/__init__.py index 40affc4b..2460f316 100644 --- a/cloudinit/transforms/__init__.py +++ b/cloudinit/transforms/__init__.py @@ -26,9 +26,9 @@ from cloudinit import log as logging LOG = logging.getLogger(__name__) -def form_module_name(name): +def form_transform_name(name): canon_name = name.replace("-", "_") - if canon_name.endswith(".py"): + if canon_name.lower().endswith(".py"): canon_name = canon_name[0:(len(canon_name) - 3)] canon_name = canon_name.strip() if not canon_name: @@ -38,7 +38,7 @@ def form_module_name(name): return canon_name -def fixup_module(mod, def_freq=PER_INSTANCE): +def fixup_transform(mod, def_freq=PER_INSTANCE): if not hasattr(mod, 'frequency'): setattr(mod, 'frequency', def_freq) else: @@ -49,7 +49,6 @@ def fixup_module(mod, def_freq=PER_INSTANCE): def empty_handle(_name, _cfg, _cloud, _log, _args): pass setattr(mod, 'handle', empty_handle) - # Used only for warning if possibly running on a not checked distro... if not hasattr(mod, 'distros'): setattr(mod, 'distros', None) return mod -- cgit v1.2.3