Skip to content

Commit 2d6894b

Browse files
bugfix: fix inventory plugin name preventing plugin from working
1 parent aeb8cba commit 2d6894b

File tree

6 files changed

+13
-5
lines changed

6 files changed

+13
-5
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ env:
99
global:
1010
- COLLECTION_NAMESPACE: netbox
1111
- COLLECTION_NAME: netbox
12-
- COLLECTION_VERSION: 0.1.9
12+
- COLLECTION_VERSION: 0.1.10
1313
- secure: "tE6GtwrRU+Kjobx/94xqR2MqM20pHCnrLcHgPzIHA3npdwuA+GjCBiBLTkEEQM4fUWIfzUTyjSr9bZErm1PTI1GcIRdniTgJ3ZzSSkE7tgeYALB/7xsusB57SlmbBQm2SGwU558uWZ3NHEsi0WTgD8GKZo77OpGX72FZKsVXOz6k2wve51sOtoSVjgCsvWTmZHx4ynGdiA5wFkZfaEcjXECahKtunW+MlB5kpJzkVeLRUEXFMhWlsIYiA5nj8OI/X3Nk9ugh1ribENX9LrjpgrqQ9YariZ8G6py1ONuKZIn2g7xs5kNQ3qL6HL6N7SoUxiwH16CfSyugFaYiMfaxQ4NUVGGRHS4vSGbNIf+gLHcYvP40miI1f/+pntCzqygZMhW73FX2o+KH2OGv09khOl8k1nDg2/XvW0kCc/FU6l+Jp5wCC8H9X2uiULtQpRqts5TzIonlPEzGIpfGFgJ5m54Emhv9gjG1Z5OOyL/qae1Wr+L/uhiFafcglZYh8NHEMWCUCkeqFqR2kDmUMtdgYLD7Q7NdwlL/PSVVs1l7UPiQHlnecQKEHN7CvR3eKByTEmkCKafRYh/JQ9rBt9sZc7aAPVu+w3wWUwbHS4o4vVnmyXvJb1PeJSiuynF7CBo4Qd6qj4YwX8gLK6PylGyaMOp169u6xw1mo5/CX0pJ3x4="
1414

1515
matrix:
@@ -62,6 +62,8 @@ script:
6262
- python tests/integration/netbox-deploy.py
6363
- ansible-playbook tests/integration/regression-tests.yml -vvvv
6464
- ansible-playbook tests/integration/integration-tests.yml -vvvv
65+
- cd tests/integration
66+
- ansible-inventory -i test-inventory.yml --list
6567

6668
deploy:
6769
provider: script

galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace: netbox
99
name: netbox
1010

1111
# The version of the collection. Must be compatible with semantic versioning
12-
version: 0.1.9
12+
version: 0.1.10
1313

1414
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
1515
readme: README.md

plugins/inventory/nb_inventory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198

199199

200200
class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
201-
NAME = "netbox.netbox.netbox"
201+
NAME = "netbox.netbox.nb_inventory"
202202

203203
def _fetch_information(self, url):
204204
results = None

tests/integration/ansible.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[inventory]
2+
enable_plugins = netbox.netbox.nb_inventory

tests/integration/netbox-deploy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@
199199

200200
## Create Interfaces
201201
dev_interfaces = [
202-
{"name": "GigabitEthernet1", "device": test100.id, "form_factor": 1000},
203-
{"name": "GigabitEthernet2", "device": test100.id, "form_factor": 1000},
202+
{"name": "GigabitEthernet1", "device": test100.id, "type": 1000},
203+
{"name": "GigabitEthernet2", "device": test100.id, "type": 1000},
204204
]
205205
created_interfaces = nb.dcim.interfaces.create(dev_interfaces)
206206
## Interface variables to be used later on

tests/integration/test-inventory.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
plugin: netbox.netbox.nb_inventory
2+
api_endpoint: "http://localhost:32768"
3+
token: "0123456789abcdef0123456789abcdef01234567"
4+
validate_certs: false

0 commit comments

Comments
 (0)