mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Netbox inventory: Fix NoneType issue if query_filters is not in netbox_inventory.yml (#46793)
* Added if state to refresh_url to avoid failure at NoneType when guesry_filters is undefined in netbox_inventory.yml
This commit is contained in:
parent
4219d25fc7
commit
f83fa2ac93
1 changed files with 3 additions and 2 deletions
|
@ -352,6 +352,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
|
|||
|
||||
def refresh_url(self):
|
||||
query_parameters = [("limit", 0)]
|
||||
if self.query_filters:
|
||||
query_parameters.extend(filter(lambda x: x,
|
||||
map(self.validate_query_parameters, self.query_filters)))
|
||||
self.device_url = self.api_endpoint + "/api/dcim/devices/" + "?" + urlencode(query_parameters)
|
||||
|
|
Loading…
Reference in a new issue