summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_scripts_vendor.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2014-01-15 17:13:24 -0500
committerScott Moser <smoser@ubuntu.com>2014-01-15 17:13:24 -0500
commit9e19b276fdb6cf9c1f5252f6f9bdcba076c5f09e (patch)
treec9d9f635c340d7f1e2e108c2e81ee9f16ff82845 /cloudinit/config/cc_scripts_vendor.py
parent42f2cffadabfefb0469ade2f1f1c3ce5edabc9fa (diff)
downloadvyos-cloud-init-9e19b276fdb6cf9c1f5252f6f9bdcba076c5f09e.tar.gz
vyos-cloud-init-9e19b276fdb6cf9c1f5252f6f9bdcba076c5f09e.zip
replace get_nested_option_as_list with get_cfg_by_path, improve ruparts
this makes runparts take exe_prefix and do string to list conversion inside. that means we don't have to do it in cc_scripts_vendor. Also, get_nested_option_as_list was essentially get_cfg_by_path anyway.
Diffstat (limited to 'cloudinit/config/cc_scripts_vendor.py')
-rw-r--r--cloudinit/config/cc_scripts_vendor.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/cloudinit/config/cc_scripts_vendor.py b/cloudinit/config/cc_scripts_vendor.py
index 0168f668..0c9e504e 100644
--- a/cloudinit/config/cc_scripts_vendor.py
+++ b/cloudinit/config/cc_scripts_vendor.py
@@ -27,13 +27,16 @@ frequency = PER_INSTANCE
SCRIPT_SUBDIR = 'vendor'
-def handle(name, _cfg, cloud, log, _args):
+def handle(name, cfg, cloud, log, _args):
# This is written to by the vendor data handlers
# any vendor data shell scripts get placed in runparts_path
runparts_path = os.path.join(cloud.get_ipath_cur(), 'scripts',
SCRIPT_SUBDIR)
+
+ prefix = util.get_cfg_by_path(cfg, ('vendor_data', 'prefix'), [])
+
try:
- util.runparts(runparts_path)
+ util.runparts(runparts_path, exe_prefix=prefix)
except:
log.warn("Failed to run module %s (%s in %s)",
name, SCRIPT_SUBDIR, runparts_path)