Skip to content

Commit f93f23c

Browse files
authored
Merge pull request #201 from networktocode/dga-inventory-driver
Add driver to inventory command
2 parents 5fa4665 + cce78f4 commit f93f23c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

network_importer/cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ def inventory(config_file, limit, debug, update_configs):
187187

188188
table.add_column("Device", style="cyan", no_wrap=True)
189189
table.add_column("Platform", style="magenta")
190+
table.add_column("Driver")
190191
table.add_column("Reachable")
191192
table.add_column("Reason")
192193

@@ -198,7 +199,8 @@ def inventory(config_file, limit, debug, update_configs):
198199
is_reachable = "[red]False"
199200
reason = f"[red]{host.data['not_reachable_reason']}"
200201

201-
table.add_row(hostname, host.data["vendor"], is_reachable, reason)
202+
driver = config.SETTINGS.drivers.mapping.get(host.platform, config.SETTINGS.drivers.mapping.get("default"))
203+
table.add_row(hostname, host.platform, driver, is_reachable, reason)
202204

203205
console = Console()
204206
console.print(table)

0 commit comments

Comments
 (0)