diff --git a/nautobot_chatops/integrations/ipfabric/worker.py b/nautobot_chatops/integrations/ipfabric/worker.py index 89544646..abeb2c1b 100644 --- a/nautobot_chatops/integrations/ipfabric/worker.py +++ b/nautobot_chatops/integrations/ipfabric/worker.py @@ -3,6 +3,7 @@ import tempfile import os from datetime import datetime +import pandas as pd from django.conf import settings from django_rq import job @@ -1068,11 +1069,15 @@ def table_diff( else: for key in diff: if len(diff[key]) > 0: - dispatcher.send_large_table( - diff[key][0].keys(), - [[row[i] for i in row] for row in diff[key]], - title=f"{key.title()}", - ) + try: + dispatcher.send_large_table( + diff[key][0].keys(), + [[row[i] for i in row] for row in diff[key]], + title=f"{key.title()}", + ) + except ValueError: + text = pd.DataFrame(diff[key]) + dispatcher.send_snippet(text=text.to_csv(index=False), title=key) else: dispatcher.send_markdown(f"{key.title()}: None") return CommandStatusChoices.STATUS_SUCCEEDED diff --git a/pyproject.toml b/pyproject.toml index 0cd34045..ff733a10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,6 +48,7 @@ nautobot-capacity-metrics = "*" netmiko = { version = "^3.4.0", optional = true } netutils = { version = "^1.1.0", optional = true } pan-os-python = { version = "^1.3.0", optional = true } +pandas = { version = "^1.5.3", optional = true } prettytable = { version = "^2.1.0", optional = true } protobuf = { version = "^3.17", optional = true } pydantic = { version = "^1.8.2", optional = true } @@ -104,6 +105,7 @@ all = [ "netmiko", "netutils", "pan-os-python", + "pandas", "prettytable", "protobuf", "pydantic", @@ -133,6 +135,7 @@ ipfabric = [ "ipfabric", "ipfabric-diagrams", "netutils", + "pandas", ] meraki = [ "meraki",