From ca2c366309cf5efb24c01f20ab1e6bd321fcbf3a Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Sat, 6 Apr 2024 16:00:57 +0200 Subject: [PATCH] Respect is_management_address for provider_networks When generating inventory first check that is done, if user has defined a container/management network. However, this logic ignores is_management_address / is_container_address keys. At the same time it expects another key - `address_prefix` which can or should be set to `container` or `management`. Change-Id: I49ebd1e0925a4b088b42bdf875b5f0b2dcc7eeae --- osa_toolkit/generate.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/osa_toolkit/generate.py b/osa_toolkit/generate.py index 8f052c7927..55590d6ee1 100755 --- a/osa_toolkit/generate.py +++ b/osa_toolkit/generate.py @@ -1170,8 +1170,11 @@ def main(config=None, check=False, debug=False, environment=None, **kwargs): continue q_name = p_net.get('ip_from_q') if q_name and q_name in cidr_networks: - if (p_net.get('address_prefix') in ('container', - 'management')): + addr_prefix = p_net.get('address_prefix') + is_mgmt = p_net.get( + 'is_management_address', p_net.get('is_container_address') + ) + if (addr_prefix in ('container', 'management') or is_mgmt): if user_cidr is None: user_cidr = [] user_cidr.append(cidr_networks[q_name])