- Update cloud-init-write-routes.patch (bsc#1163178)

+ Entries in the routes definition have changed causing a traceback
    during rout config file writing. This patch update addresses the
    issue by extracting the new entries properly.

OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=161
This commit is contained in:
Robert Schweikert 2020-02-12 19:33:31 +00:00 committed by Git OBS Bridge
parent 5a5220c868
commit 3bb80bd89a
2 changed files with 18 additions and 4 deletions

View File

@ -8,7 +8,7 @@
from cloudinit import helpers
from cloudinit import log as logging
@@ -172,7 +173,47 @@ class Distro(distros.Distro):
@@ -172,7 +173,53 @@ class Distro(distros.Distro):
util.write_file(out_fn, str(conf), 0o644)
def _write_network_config(self, netconfig):
@ -34,12 +34,18 @@
+ for subnet in subnets:
+ routes = subnet.get('routes', [])
+ for route in routes:
+ dest = route.get('network')
+ dest = route.get('destination')
+ if dest in default_nets:
+ dest = 'default'
+ if dest != 'default':
+ prefix = mask_to_net_prefix(route.get('netmask'))
+ dest += '/' + str(prefix)
+ netmask = route.get('genmask')
+ if netmask:
+ prefix = mask_to_net_prefix(netmask)
+ dest += '/' + str(prefix)
+ if '/' not in dest:
+ LOG.warning(
+ 'Route destination has no prefix "%s"', dest
+ )
+ gateway = route.get('gateway')
+ config_routes += ' '.join(
+ [dest, gateway, '-', '-\n']

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Feb 12 19:30:42 UTC 2020 - Robert Schweikert <rjschwei@suse.com>
- Update cloud-init-write-routes.patch (bsc#1163178)
+ Entries in the routes definition have changed causing a traceback
during rout config file writing. This patch update addresses the
issue by extracting the new entries properly.
-------------------------------------------------------------------
Fri Jan 17 18:55:41 UTC 2020 - Robert Schweikert <rjschwei@suse.com>