Skip to content

Commit

Permalink
Fix import failure when no vendor specified
Browse files Browse the repository at this point in the history
Close netbox-community#44 
Fix regression introduced by netbox-community#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.
  • Loading branch information
dalrrard authored Dec 16, 2021
1 parent 625bdba commit f0c53e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
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()
Expand Down

0 comments on commit f0c53e2

Please sign in to comment.