SHA256
1
0
forked from pool/cloud-init

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

+ Add the default gateway to the ifroute config file when specified
    as part of the subnet configuration
  + Fix typo to properly extrakt provided netmask data (bsc#1163178)

OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=165
This commit is contained in:
Robert Schweikert 2020-03-25 19:41:57 +00:00 committed by Git OBS Bridge
parent d41fefb9da
commit d59aba31a6
2 changed files with 17 additions and 2 deletions

View File

@ -8,7 +8,7 @@
from cloudinit import helpers
from cloudinit import log as logging
@@ -172,7 +173,53 @@ class Distro(distros.Distro):
@@ -172,7 +173,60 @@ class Distro(distros.Distro):
util.write_file(out_fn, str(conf), 0o644)
def _write_network_config(self, netconfig):
@ -32,13 +32,20 @@
+ subnets = config.get('subnets', [])
+ config_routes = ''
+ for subnet in subnets:
+ # Render the default gateway if it is present
+ gateway = subnet.get('gateway')
+ if gateway:
+ config_routes += ' '.join(
+ ['default', gateway, '-', '-\n']
+ )
+ # Render subnet routes
+ routes = subnet.get('routes', [])
+ for route in routes:
+ dest = route.get('destination')
+ if dest in default_nets:
+ dest = 'default'
+ if dest != 'default':
+ netmask = route.get('genmask')
+ netmask = route.get('netmask')
+ if netmask:
+ prefix = mask_to_net_prefix(netmask)
+ dest += '/' + str(prefix)

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Mar 25 18:31:32 UTC 2020 - Robert Schweikert <rjschwei@suse.com>
- Update cloud-init-write-routes.patch (bsc#1165296)
+ Add the default gateway to the ifroute config file when specified
as part of the subnet configuration
+ Fix typo to properly extrakt provided netmask data (bsc#1163178)
-------------------------------------------------------------------
Thu Feb 13 14:07:50 UTC 2020 - Robert Schweikert <rjschwei@suse.com>