diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-16 09:32:22 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-16 09:32:22 -0700 |
commit | c23ade677e59e67d4d84ee111e337a99d11271e2 (patch) | |
tree | a407add8727e4e758d56e86e42ac12875065fd20 | |
parent | 1b5e8117d862743f8f66cd27462965cc6c89af90 (diff) | |
download | vyos-cloud-init-c23ade677e59e67d4d84ee111e337a99d11271e2.tar.gz vyos-cloud-init-c23ade677e59e67d4d84ee111e337a99d11271e2.zip |
1. Change to fixup transform/form transform name
2. Check lowercase name against .py instead of unknown case.
-rw-r--r-- | cloudinit/transforms/__init__.py | 7 |
1 files 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 |