From f0c53e29a3a1b49891762f903527b5c2ced79899 Mon Sep 17 00:00:00 2001 From: dalrrard <8892319+dalrrard@users.noreply.github.com> Date: Thu, 16 Dec 2021 16:26:22 -0600 Subject: [PATCH] Fix import failure when no vendor specified Close #44 Fix regression introduced by #34 Check to see if each item in the list produced by `split` is iterable. If it is not, remove it. This should only occur when no vendor is specified since a non-empty string is truthy. --- settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/settings.py b/settings.py index 4a29642..305a4dc 100644 --- a/settings.py +++ b/settings.py @@ -8,8 +8,8 @@ NETBOX_URL = os.getenv("NETBOX_URL") NETBOX_TOKEN = os.getenv("NETBOX_TOKEN") IGNORE_SSL_ERRORS = (os.getenv("IGNORE_SSL_ERRORS", "False") == "True") -# optionnally load vendors through a space separated list as env var -VENDORS = os.getenv("VENDORS", "").split(",") +# optionally load vendors through a comma separated list as env var +VENDORS = list(filter(None, os.getenv("VENDORS", "").split(","))) # optionally load device types through a space separated list as env var SLUGS = os.getenv("SLUGS", "").split()