Skip to content

Commit df0a6cf

Browse files
authored
Allows lookup plugin to use a netbox configured for anonymous-readonly (#184)
1 parent 36c6b16 commit df0a6cf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

plugins/lookup/nb_lookup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
token:
4848
description:
4949
- The API token created through Netbox
50-
required: True
50+
- This may not be required depending on the Netbox setup.
51+
required: False
5152
key_file:
5253
description:
5354
- The location of the private key tied to user account.
@@ -199,7 +200,7 @@ def run(self, terms, variables=None, **kwargs):
199200
try:
200201
netbox = pynetbox.api(
201202
netbox_api_endpoint,
202-
token=netbox_api_token,
203+
token=netbox_api_token if netbox_api_token else None,
203204
private_key_file=netbox_private_key_file,
204205
)
205206
except FileNotFoundError:

0 commit comments

Comments
 (0)