Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion osism/commands/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,12 @@ def take_action(self, parsed_args):
continue

lldp_data = json.loads(lldp_result.stdout)
interfaces = lldp_data.get("lldp", {}).get("interface", [])
interfaces = lldp_data.get("lldp", {}).get("interface", {})

# lldpctl returns a list of dicts for multiple interfaces,
# but a single dict for one interface. Normalize to list.
if isinstance(interfaces, dict):
interfaces = [{k: v} for k, v in interfaces.items()]

for iface_entry in interfaces:
for local_iface, iface_data in iface_entry.items():
Expand Down