summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2016-03-04 01:56:43 -0500
committerScott Moser <smoser@ubuntu.com>2016-03-04 01:56:43 -0500
commitd4aa1ab6837a178e4efc79b4443b7609e50fa68f (patch)
treeec4f76ea5260e269c83addbfafa4376ea2678059
parent8092805079d011093724d87e9485e5bf79479a72 (diff)
parent1a9a408a7bf6d7a1a06254ad2939bd549acba69b (diff)
downloadvyos-cloud-init-d4aa1ab6837a178e4efc79b4443b7609e50fa68f.tar.gz
vyos-cloud-init-d4aa1ab6837a178e4efc79b4443b7609e50fa68f.zip
Add a kill switch for customization on VMware platform.
The customization is set to False by default and is triggered only when the option disable_vmware_customization is set to false in /etc/cloud/cloud.cfg.
-rw-r--r--cloudinit/sources/DataSourceOVF.py31
1 files changed, 17 insertions, 14 deletions
diff --git a/cloudinit/sources/DataSourceOVF.py b/cloudinit/sources/DataSourceOVF.py
index 8e97e51a..23996b4a 100644
--- a/cloudinit/sources/DataSourceOVF.py
+++ b/cloudinit/sources/DataSourceOVF.py
@@ -68,21 +68,24 @@ class DataSourceOVF(sources.DataSource):
if system_type is None:
LOG.debug("No system-product-name found")
elif 'vmware' in system_type.lower():
- LOG.debug("VMware Virtual Platform found")
- deployPkgPluginPath = search_file("/usr/lib/vmware-tools",
- "libdeployPkgPlugin.so")
- if deployPkgPluginPath:
- vmwareImcConfigFilePath = \
- util.log_time(logfunc=LOG.debug,
- msg="waiting for configuration file",
- func=wait_for_imc_cfg_file,
- args=("/tmp", "cust.cfg"))
-
- if vmwareImcConfigFilePath:
- LOG.debug("Found VMware DeployPkg Config File Path at %s" %
- vmwareImcConfigFilePath)
+ LOG.debug("VMware Virtualization Platform found")
+ if not util.get_cfg_option_bool(
+ self.sys_cfg, "disable_vmware_customization", True):
+ deployPkgPluginPath = search_file("/usr/lib/vmware-tools",
+ "libdeployPkgPlugin.so")
+ if deployPkgPluginPath:
+ vmwareImcConfigFilePath = util.log_time(
+ logfunc=LOG.debug,
+ msg="waiting for configuration file",
+ func=wait_for_imc_cfg_file, args=("/tmp", "cust.cfg"))
+
+ if vmwareImcConfigFilePath:
+ LOG.debug("Found VMware DeployPkg Config File at %s" %
+ vmwareImcConfigFilePath)
+ else:
+ LOG.debug("Did not find VMware DeployPkg Config File Path")
else:
- LOG.debug("Didn't find VMware DeployPkg Config File Path")
+ LOG.debug("Customization for VMware platform is disabled.")
if vmwareImcConfigFilePath:
try: