diff options
author | Barry Warsaw <barry@python.org> | 2015-01-26 17:05:21 -0500 |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2015-01-26 17:05:21 -0500 |
commit | fe99f7d6d87e88320933957b2933288c6eb2986d (patch) | |
tree | 82aff0c8aecaf6e87cfb77aea04d944965bc25f5 /cloudinit/sources/DataSourceSmartOS.py | |
parent | fabff4aec884467729fc372bb67f240752c15511 (diff) | |
parent | 78915c97c18d678db10e0fde0d9306823c5f4610 (diff) | |
download | vyos-cloud-init-fe99f7d6d87e88320933957b2933288c6eb2986d.tar.gz vyos-cloud-init-fe99f7d6d87e88320933957b2933288c6eb2986d.zip |
Trunk merged and ported.
Diffstat (limited to 'cloudinit/sources/DataSourceSmartOS.py')
-rw-r--r-- | cloudinit/sources/DataSourceSmartOS.py | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/cloudinit/sources/DataSourceSmartOS.py b/cloudinit/sources/DataSourceSmartOS.py index d3ed40c5..f59ad3d6 100644 --- a/cloudinit/sources/DataSourceSmartOS.py +++ b/cloudinit/sources/DataSourceSmartOS.py @@ -370,26 +370,13 @@ def query_data(noun, seed_device, seed_timeout, strip=False, default=None, def dmi_data(): - sys_uuid, sys_type = None, None - dmidecode_path = util.which('dmidecode') - if not dmidecode_path: - return False + 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 - sys_uuid_cmd = [dmidecode_path, "-s", "system-uuid"] - try: - LOG.debug("Getting hostname from dmidecode") - (sys_uuid, _err) = util.subp(sys_uuid_cmd) - except Exception as e: - util.logexc(LOG, "Failed to get system UUID", e) - - sys_type_cmd = [dmidecode_path, "-s", "system-product-name"] - try: - LOG.debug("Determining hypervisor product name via dmidecode") - (sys_type, _err) = util.subp(sys_type_cmd) - except Exception as e: - util.logexc(LOG, "Failed to get system UUID", e) - - return (sys_uuid.lower().strip(), sys_type.strip()) + return (sys_uuid.lower(), sys_type) def write_boot_content(content, content_f, link=None, shebang=False, |