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/DataSourceGCE.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/DataSourceGCE.py')
-rw-r--r-- | cloudinit/sources/DataSourceGCE.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/sources/DataSourceGCE.py b/cloudinit/sources/DataSourceGCE.py index 0ec5f6ec..746caddb 100644 --- a/cloudinit/sources/DataSourceGCE.py +++ b/cloudinit/sources/DataSourceGCE.py @@ -7,6 +7,7 @@ import json from base64 import b64decode +from cloudinit import dmi from cloudinit.distros import ug_util from cloudinit import log as logging from cloudinit import sources @@ -248,12 +249,12 @@ def read_md(address=None, platform_check=True): def platform_reports_gce(): - pname = util.read_dmi_data('system-product-name') or "N/A" + pname = dmi.read_dmi_data('system-product-name') or "N/A" if pname == "Google Compute Engine": return True # system-product-name is not always guaranteed (LP: #1674861) - serial = util.read_dmi_data('system-serial-number') or "N/A" + serial = dmi.read_dmi_data('system-serial-number') or "N/A" if serial.startswith("GoogleCloud-"): return True |