diff options
author | Sankar Tanguturi <stanguturi@stanguturi-rhel> | 2016-02-18 18:31:07 -0800 |
---|---|---|
committer | Sankar Tanguturi <stanguturi@stanguturi-rhel> | 2016-02-18 18:31:07 -0800 |
commit | c5d2f79a982258d86181368b25ce6bc6638ef645 (patch) | |
tree | b43be2d9ad68ef752fa53f53f69615ed39b0273c /cloudinit/sources/DataSourceOVF.py | |
parent | 0ce71cb8975e19677eea415101e15da5f4095cd5 (diff) | |
download | vyos-cloud-init-c5d2f79a982258d86181368b25ce6bc6638ef645.tar.gz vyos-cloud-init-c5d2f79a982258d86181368b25ce6bc6638ef645.zip |
- Removed dmi_data function.
- Fixed few variable names.
- Used util.subp methods for process related manipulations.
Diffstat (limited to 'cloudinit/sources/DataSourceOVF.py')
-rw-r--r-- | cloudinit/sources/DataSourceOVF.py | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/cloudinit/sources/DataSourceOVF.py b/cloudinit/sources/DataSourceOVF.py index 6d3bf7bb..72ba5aba 100644 --- a/cloudinit/sources/DataSourceOVF.py +++ b/cloudinit/sources/DataSourceOVF.py @@ -63,15 +63,11 @@ class DataSourceOVF(sources.DataSource): } (seedfile, contents) = get_ovf_env(self.paths.seed_dir) - dmi_info = dmi_data() - system_type = "" - if dmi_info is None: - LOG.debug("No dmidata utility found") - else: - (_, system_type) = dmi_info - - if 'vmware' in system_type.lower(): + system_type = util.read_dmi_data("system-product-name") + 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: @@ -347,14 +343,6 @@ def get_properties(contents): return props -def dmi_data(): - sys_uuid = util.read_dmi_data("system-uuid") - sys_type = util.read_dmi_data("system-product-name") - - if not sys_uuid or not sys_type: - return None - - return (sys_uuid.lower(), sys_type) def search_file(dirpath, filename): if not dirpath or not filename: |