Skip to content

Commit f0c53e2

Browse files
authored
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.
1 parent 625bdba commit f0c53e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
NETBOX_TOKEN = os.getenv("NETBOX_TOKEN")
99
IGNORE_SSL_ERRORS = (os.getenv("IGNORE_SSL_ERRORS", "False") == "True")
1010

11-
# optionnally load vendors through a space separated list as env var
12-
VENDORS = os.getenv("VENDORS", "").split(",")
11+
# optionally load vendors through a comma separated list as env var
12+
VENDORS = list(filter(None, os.getenv("VENDORS", "").split(",")))
1313

1414
# optionally load device types through a space separated list as env var
1515
SLUGS = os.getenv("SLUGS", "").split()

0 commit comments

Comments
 (0)