diff options
author | Scott Moser <smoser@brickies.net> | 2020-11-02 15:41:11 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-02 15:41:11 -0500 |
commit | 0af1ff1eaf593c325b4f53181a572110eb016c50 (patch) | |
tree | 2e0dab084dffd4664a6320f15baf374aff008917 /cloudinit/sources/DataSourceOpenStack.py | |
parent | d619f5171ac0ce5b626ef4575ad5f4468e94c987 (diff) | |
download | vyos-cloud-init-0af1ff1eaf593c325b4f53181a572110eb016c50.tar.gz vyos-cloud-init-0af1ff1eaf593c325b4f53181a572110eb016c50.zip |
cloudinit: move dmi functions out of util (#622)
This just separates the reading of dmi values into its own file.
Some things of note:
* left import of util in dmi.py only for 'is_container'
It'd be good if is_container was not in util.
* just the use of 'util.is_x86' to dmi.py
* open() is used directly rather than load_file.
Diffstat (limited to 'cloudinit/sources/DataSourceOpenStack.py')
-rw-r--r-- | cloudinit/sources/DataSourceOpenStack.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/sources/DataSourceOpenStack.py b/cloudinit/sources/DataSourceOpenStack.py index 0ede0a0e..b3406c67 100644 --- a/cloudinit/sources/DataSourceOpenStack.py +++ b/cloudinit/sources/DataSourceOpenStack.py @@ -6,6 +6,7 @@ import time +from cloudinit import dmi from cloudinit import log as logging from cloudinit.net.dhcp import EphemeralDHCPv4, NoDHCPLeaseError from cloudinit import sources @@ -225,10 +226,10 @@ def detect_openstack(accept_oracle=False): """Return True when a potential OpenStack platform is detected.""" if not util.is_x86(): return True # Non-Intel cpus don't properly report dmi product names - product_name = util.read_dmi_data('system-product-name') + product_name = dmi.read_dmi_data('system-product-name') if product_name in VALID_DMI_PRODUCT_NAMES: return True - elif util.read_dmi_data('chassis-asset-tag') in VALID_DMI_ASSET_TAGS: + elif dmi.read_dmi_data('chassis-asset-tag') in VALID_DMI_ASSET_TAGS: return True elif accept_oracle and oracle._is_platform_viable(): return True |