summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceHetzner.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/sources/DataSourceHetzner.py')
-rw-r--r--cloudinit/sources/DataSourceHetzner.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/cloudinit/sources/DataSourceHetzner.py b/cloudinit/sources/DataSourceHetzner.py
index 769fe131..5c75b65b 100644
--- a/cloudinit/sources/DataSourceHetzner.py
+++ b/cloudinit/sources/DataSourceHetzner.py
@@ -44,6 +44,8 @@ class DataSourceHetzner(sources.DataSource):
self.dsmode = sources.DSMODE_NETWORK
def get_data(self):
+ if not on_hetzner():
+ return False
nic = cloudnet.find_fallback_nic()
with cloudnet.EphemeralIPv4Network(nic, "169.254.0.1", 16,
"169.254.255.255"):
@@ -87,6 +89,10 @@ class DataSourceHetzner(sources.DataSource):
return self._network_config
+def on_hetzner():
+ return util.read_dmi_data('system-manufacturer') == "Hetzner"
+
+
# Used to match classes to dependencies
datasources = [
(DataSourceHetzner, (sources.DEP_FILESYSTEM, )),