diff options
author | Sankar Tanguturi <stanguturi@stanguturi-rhel> | 2016-03-01 16:43:50 -0800 |
---|---|---|
committer | Sankar Tanguturi <stanguturi@stanguturi-rhel> | 2016-03-01 16:43:50 -0800 |
commit | 51a27968ae9805c747cdc27d35a31c49df6d2217 (patch) | |
tree | ce5dbfbc530d2eca4d9724853a53501145507e53 /cloudinit/sources/DataSourceOVF.py | |
parent | c5d2f79a982258d86181368b25ce6bc6638ef645 (diff) | |
download | vyos-cloud-init-51a27968ae9805c747cdc27d35a31c49df6d2217.tar.gz vyos-cloud-init-51a27968ae9805c747cdc27d35a31c49df6d2217.zip |
Added 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
Diffstat (limited to 'cloudinit/sources/DataSourceOVF.py')
-rw-r--r-- | cloudinit/sources/DataSourceOVF.py | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/cloudinit/sources/DataSourceOVF.py b/cloudinit/sources/DataSourceOVF.py index 72ba5aba..d92c128c 100644 --- a/cloudinit/sources/DataSourceOVF.py +++ b/cloudinit/sources/DataSourceOVF.py @@ -68,18 +68,23 @@ 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 Path 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: |