From c4bb53fe991bc88bf3cda37a9b9144e8ae8854f5 Mon Sep 17 00:00:00 2001 From: Brandon Squizzato Date: Mon, 13 Dec 2021 20:53:41 -0500 Subject: [PATCH] Tweak .get default --- bonfire/namespaces.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bonfire/namespaces.py b/bonfire/namespaces.py index 7ca21a7f..ee1fe924 100644 --- a/bonfire/namespaces.py +++ b/bonfire/namespaces.py @@ -195,14 +195,14 @@ def get_namespaces(available=False, mine=False): for ns in all_namespaces: ns_name = ns["metadata"]["name"] clowdapps_data = [ - app for app in all_clowdapps if app.get("metadata").get("namespace") == ns_name - ] or None + app for app in all_clowdapps if app.get("metadata", {}).get("namespace") == ns_name + ] reservation_data = [ res for res in all_res if res.get("status", {}).get("namespace") == ns_name ] kwargs = { "namespace_data": ns, - "clowdapps_data": clowdapps_data, + "clowdapps_data": clowdapps_data or None, "reservation_data": reservation_data[0] if reservation_data else None, } all_ns_kwargs.append(kwargs)