summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-06-16 20:44:58 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-06-16 20:44:58 -0700
commita2e75f6d01688026b7ccfe5d71a11fff6205a287 (patch)
tree01e251f8eb24ae461c17d5bd2421b016dea60252 /cloudinit
parent71a661de85dc910c82c6769430232b555a86198a (diff)
downloadvyos-cloud-init-a2e75f6d01688026b7ccfe5d71a11fff6205a287.tar.gz
vyos-cloud-init-a2e75f6d01688026b7ccfe5d71a11fff6205a287.zip
1. Fix the welcome_msg name to welcome_message (oops)
2. Adjust that name in the cloud.cfg 3. Add in the ability to specify a dictionary that is the transform instead of a list which makes the config look nicer when users have custom transforms with arguments and such.
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/stages.py12
-rw-r--r--cloudinit/transforms/welcome_message.py (renamed from cloudinit/transforms/welcome_msg.py)0
2 files changed, 12 insertions, 0 deletions
diff --git a/cloudinit/stages.py b/cloudinit/stages.py
index 70f2bcc9..ba6cb915 100644
--- a/cloudinit/stages.py
+++ b/cloudinit/stages.py
@@ -431,6 +431,18 @@ class Transforms(object):
contents['args'] = item[2:]
if contents:
module_list.append(contents)
+ elif isinstance(item, (dict)):
+ contents = {}
+ valid = False
+ if 'name' in item:
+ contents['mod'] = item['name'].strip()
+ valid = True
+ if 'frequency' in item:
+ contents['freq'] = item['frequency'].strip()
+ if 'args' in item:
+ contents['args'] = item['args'] or []
+ if contents and valid:
+ module_list.append(contents)
else:
raise TypeError(("Failed to read '%s' item in config,"
" unknown type %s") %
diff --git a/cloudinit/transforms/welcome_msg.py b/cloudinit/transforms/welcome_message.py
index 04691d21..04691d21 100644
--- a/cloudinit/transforms/welcome_msg.py
+++ b/cloudinit/transforms/welcome_message.py