forked from pool/cloud-init
- Update cloud-init-write-routes.patch (bsc#1177526)
+ Fix missing default route when dual stack network setup is used. Once a default route was configured for Ipv6 or IPv4 the default route configuration for the othre protocol was skipped. OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=175
This commit is contained in:
parent
b0c63d0e77
commit
e0a3626f42
@ -10,7 +10,7 @@ Index: cloudinit/distros/opensuse.py
|
||||
|
||||
from cloudinit import helpers
|
||||
from cloudinit import log as logging
|
||||
@@ -174,7 +175,140 @@ class Distro(distros.Distro):
|
||||
@@ -174,7 +175,147 @@ class Distro(distros.Distro):
|
||||
util.write_file(out_fn, str(conf), 0o644)
|
||||
|
||||
def _write_network_config(self, netconfig):
|
||||
@ -34,6 +34,7 @@ Index: cloudinit/distros/opensuse.py
|
||||
+ subnets = config.get('subnets', [])
|
||||
+ config_routes = ''
|
||||
+ has_default_route = False
|
||||
+ seen_default_gateway = None
|
||||
+ for subnet in subnets:
|
||||
+ # Render the default gateway if it is present
|
||||
+ gateway = subnet.get('gateway')
|
||||
@ -42,6 +43,8 @@ Index: cloudinit/distros/opensuse.py
|
||||
+ ['default', gateway, '-', '-\n']
|
||||
+ )
|
||||
+ has_default_route = True
|
||||
+ if not seen_default_gateway:
|
||||
+ seen_default_gateway = gateway
|
||||
+ # Render subnet routes
|
||||
+ routes = subnet.get('routes', [])
|
||||
+ for route in routes:
|
||||
@ -58,7 +61,11 @@ Index: cloudinit/distros/opensuse.py
|
||||
+ 'Skipping route; has no prefix "%s"', dest
|
||||
+ )
|
||||
+ continue
|
||||
+ if dest == 'default' and has_default_route:
|
||||
+ if (
|
||||
+ dest == 'default' and
|
||||
+ has_default_route and
|
||||
+ gateway == seen_default_gateway
|
||||
+ ):
|
||||
+ dest_info = dest
|
||||
+ if gateway:
|
||||
+ dest_info = ' '.join([dest, gateway, '-', '-'])
|
||||
|
@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 10 11:39:09 UTC 2020 - Robert Schweikert <rjschwei@suse.com>
|
||||
|
||||
- Update cloud-init-write-routes.patch (bsc#1177526)
|
||||
+ Fix missing default route when dual stack network setup is used. Once
|
||||
a default route was configured for Ipv6 or IPv4 the default route
|
||||
configuration for the othre protocol was skipped.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Oct 17 10:25:30 UTC 2020 - Robert Schweikert <rjschwei@suse.com>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user