From 60998cfcc7cf749de485a0b53ef48541a9b6936f Mon Sep 17 00:00:00 2001 From: dibyanshuMoj <159048372+dibyanshuMoj@users.noreply.github.com> Date: Wed, 27 Mar 2024 15:08:09 +0000 Subject: [PATCH] Boolean Values for Env fix (#24) --- github_discovery.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/github_discovery.py b/github_discovery.py index 6045833..f9dc93f 100644 --- a/github_discovery.py +++ b/github_discovery.py @@ -168,11 +168,14 @@ def fetch_values_for_allowlist_key(yaml_data, key): # This method read the value stored in dictionary passed to it checks if the ip allow list is present or not and returns boolean -def is_ipallowList_enabled(yaml_data): +def is_ipallowList_enabled(yaml_data): ip_allow_list_enabled = False - if len(yaml_data) !=0: - ip_allow_list_enabled = True + if isinstance(yaml_data, dict): + for value in yaml_data.values(): + if isinstance(value, dict) and value: + ip_allow_list_enabled= True return ip_allow_list_enabled + def process_repo(**component): allow_list_key = "allowlist"