summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceOVF.py
diff options
context:
space:
mode:
authorXiaofeng Wang <xiaofengw@vmware.com>2019-07-16 13:09:38 +0000
committerServer Team CI Bot <josh.powers+server-team-bot@canonical.com>2019-07-16 13:09:38 +0000
commit9c47c682b7aaa185c32a68f4dea8e23e9a2ef565 (patch)
tree2a1300ae7c0c8a96466f65b1990399b3cf950f86 /cloudinit/sources/DataSourceOVF.py
parenta24550aee4c7282cd3624bf63f9501444e517678 (diff)
downloadvyos-cloud-init-9c47c682b7aaa185c32a68f4dea8e23e9a2ef565.tar.gz
vyos-cloud-init-9c47c682b7aaa185c32a68f4dea8e23e9a2ef565.zip
VMWare: Trigger the post customization script via cc_scripts module.
cloud-init does not trigger reboots of a VM therefore adding custom scripts to rc.local does not execute the post scripts. This patch moves post-scripts into per-instance scripts dir and has cc_scripts module run the post-scripts. Also in this branch: - Remove the sh interpreter and execute the customization script directly. - Update the unit test. LP: #1833192
Diffstat (limited to 'cloudinit/sources/DataSourceOVF.py')
-rw-r--r--cloudinit/sources/DataSourceOVF.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/cloudinit/sources/DataSourceOVF.py b/cloudinit/sources/DataSourceOVF.py
index 70e7a5c0..dd941d2e 100644
--- a/cloudinit/sources/DataSourceOVF.py
+++ b/cloudinit/sources/DataSourceOVF.py
@@ -148,6 +148,9 @@ class DataSourceOVF(sources.DataSource):
product_marker, os.path.join(self.paths.cloud_dir, 'data'))
special_customization = product_marker and not hasmarkerfile
customscript = self._vmware_cust_conf.custom_script_name
+ ccScriptsDir = os.path.join(
+ self.paths.get_cpath("scripts"),
+ "per-instance")
except Exception as e:
_raise_error_status(
"Error parsing the customization Config File",
@@ -201,7 +204,9 @@ class DataSourceOVF(sources.DataSource):
if customscript:
try:
- postcust = PostCustomScript(customscript, imcdirpath)
+ postcust = PostCustomScript(customscript,
+ imcdirpath,
+ ccScriptsDir)
postcust.execute()
except Exception as e:
_raise_error_status(