diff --git a/cloud-init-write-routes.patch b/cloud-init-write-routes.patch index ddae779..fa49f7c 100644 --- a/cloud-init-write-routes.patch +++ b/cloud-init-write-routes.patch @@ -51,6 +51,8 @@ Index: cloudinit/distros/opensuse.py + dest = route.get('destination') or route.get('network') + if not dest or dest in default_nets: + dest = 'default' ++ if not has_default_route: ++ has_default_route = True + if dest != 'default': + netmask = route.get('netmask') + if netmask: @@ -61,6 +63,12 @@ Index: cloudinit/distros/opensuse.py + 'Skipping route; has no prefix "%s"', dest + ) + continue ++ gateway = route.get('gateway') ++ if not gateway: ++ LOG.warning( ++ 'Missing gateway for "%s", skipping', dest ++ ) ++ continue + if ( + dest == 'default' and + has_default_route and @@ -74,14 +82,6 @@ Index: cloudinit/distros/opensuse.py + if_name, dest_info + ) + continue -+ if dest == 'default' and not has_default_route: -+ has_default_route = True -+ gateway = route.get('gateway') -+ if not gateway: -+ LOG.warning( -+ 'Missing gateway for "%s", skipping', dest -+ ) -+ continue + config_routes += ' '.join( + [dest, gateway, '-', '-\n'] + ) diff --git a/cloud-init.changes b/cloud-init.changes index 9d5f138..0ab168e 100644 --- a/cloud-init.changes +++ b/cloud-init.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Jan 4 22:27:22 UTC 2021 - Robert Schweikert + +- Update cloud-init-write-routes.patch (bsc#1180176) + + Follow up to previous changes. Fix order of operations + error to make gateway comparison between subnet configuration and + route configuration valuable rather than self-comparing. + ------------------------------------------------------------------- Mon Jan 4 19:52:33 UTC 2021 - Robert Schweikert