summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-06-19 21:44:51 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-06-19 21:44:51 -0700
commitd57681d5f1906e6187e7ca6381f6bd2d37dab3da (patch)
tree59fc954b9b961e0039a73c2232462e304094a4f6 /cloudinit
parentbd5075dc77219df36cd1209582d3e004a6d96449 (diff)
downloadvyos-cloud-init-d57681d5f1906e6187e7ca6381f6bd2d37dab3da.tar.gz
vyos-cloud-init-d57681d5f1906e6187e7ca6381f6bd2d37dab3da.zip
Allow the run single to pass in a set of args and a frequency
that will replace the initial sections args and freqency if provided. If not provided then no replacement occurs.
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/stages.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/cloudinit/stages.py b/cloudinit/stages.py
index 7e64d3cd..0c3d5915 100644
--- a/cloudinit/stages.py
+++ b/cloudinit/stages.py
@@ -521,7 +521,7 @@ class Transforms(object):
found_where.append(n)
return found_where
- def run_single(self, tr_name, section):
+ def run_single(self, tr_name, section, args=None, freq=None):
mods = self._read_transforms(section)
mod_tr = None
for mod_info in mods:
@@ -532,6 +532,12 @@ class Transforms(object):
# Nothing to run, does that transform exist there??
return (0, 0)
else:
+ # Adjust the module
+ if args:
+ mod_tr['args'] = args
+ if freq:
+ mod_tr['freq'] = freq
+ # Now resume doing the normal fixups and running
raw_mods = [mod_tr]
mostly_mods = self._fixup_transforms(raw_mods)
return self._run_transforms(mostly_mods)