summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceHetzner.py
diff options
context:
space:
mode:
authorMarkus Schade <markus.schade@hetzner.com>2020-10-30 19:12:25 +0100
committerGitHub <noreply@github.com>2020-10-30 14:12:25 -0400
commit0f8be879073148f1d67094df9ec895a873caa0d7 (patch)
treebba27990e18b65930471b3ac34c5aab3d27c6137 /cloudinit/sources/DataSourceHetzner.py
parentf72d0cb7a03cc311700ea8795edf2454172c7414 (diff)
downloadvyos-cloud-init-0f8be879073148f1d67094df9ec895a873caa0d7.tar.gz
vyos-cloud-init-0f8be879073148f1d67094df9ec895a873caa0d7.zip
Hetzner: Fix instance_id / SMBIOS serial comparison (#640)
Fixes erroneous string/int comparison introduced in 1431c8a metadata['instance-id'] is an integer but the value read from smbios is a string. The comparision would cause TypeError.
Diffstat (limited to 'cloudinit/sources/DataSourceHetzner.py')
-rw-r--r--cloudinit/sources/DataSourceHetzner.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cloudinit/sources/DataSourceHetzner.py b/cloudinit/sources/DataSourceHetzner.py
index 1d965bf7..8e4d4b69 100644
--- a/cloudinit/sources/DataSourceHetzner.py
+++ b/cloudinit/sources/DataSourceHetzner.py
@@ -82,7 +82,7 @@ class DataSourceHetzner(sources.DataSource):
self.vendordata_raw = md.get("vendor_data", None)
# instance-id and serial from SMBIOS should be identical
- if self.metadata['instance-id'] != serial:
+ if self.get_instance_id() != serial:
raise RuntimeError(
"SMBIOS serial does not match instance ID from metadata"
)