summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/sources/DataSourceOpenNebula.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/cloudinit/sources/DataSourceOpenNebula.py b/cloudinit/sources/DataSourceOpenNebula.py
index 730ec586..21603fbd 100644
--- a/cloudinit/sources/DataSourceOpenNebula.py
+++ b/cloudinit/sources/DataSourceOpenNebula.py
@@ -195,7 +195,11 @@ class OpenNebulaNetwork(object):
return self.get_field(dev, "gateway")
def get_gateway6(self, dev):
- return self.get_field(dev, "gateway6")
+ # OpenNebula 6.1.80 introduced new context parameter ETHx_IP6_GATEWAY
+ # to replace old ETHx_GATEWAY6. Old ETHx_GATEWAY6 will be removed in
+ # OpenNebula 6.4.0 (https://github.com/OpenNebula/one/issues/5536).
+ return self.get_field(dev, "ip6_gateway",
+ self.get_field(dev, "gateway6"))
def get_mask(self, dev):
return self.get_field(dev, "mask", "255.255.255.0")
@@ -440,7 +444,7 @@ def read_context_disk_dir(source_dir, distro, asuser=None):
# custom hostname -- try hostname or leave cloud-init
# itself create hostname from IP address later
- for k in ('HOSTNAME', 'PUBLIC_IP', 'IP_PUBLIC', 'ETH0_IP'):
+ for k in ('SET_HOSTNAME', 'HOSTNAME', 'PUBLIC_IP', 'IP_PUBLIC', 'ETH0_IP'):
if k in context:
results['metadata']['local-hostname'] = context[k]
break