From 15c55ee57e450d86a97b4601d16775981077b1540873c6f3321f78d31b627c95 Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Mon, 4 Jan 2021 22:34:44 +0000 Subject: [PATCH] - 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. OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=181 --- cloud-init-write-routes.patch | 16 ++++++++-------- cloud-init.changes | 8 ++++++++ 2 files changed, 16 insertions(+), 8 deletions(-) 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