#21114 Allow specifying exclude directories for Data Sources #182

Closed
opened 2026-04-05 16:22:44 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @arthanson on 3/10/2026

Fixes: #21114

Data sources support ignore rules to filter files during synchronization, but previously these rules could only match against bare filenames — making it impossible to exclude entire directories.

This change passes the full relative path to the pattern matcher, enabling path-based glob patterns like subdir/* or Wireguard-tunnels/*. Existing filename-only rules (e.g. *.txt).

Previously, _walk() called _ignore(file_name) with only the bare filename, so subdirectory patterns never matched.

*Originally created by @arthanson on 3/10/2026* ### Fixes: #21114 Data sources support ignore rules to filter files during synchronization, but previously these rules could only match against bare filenames — making it impossible to exclude entire directories. This change passes the full relative path to the pattern matcher, enabling path-based glob patterns like subdir/* or Wireguard-tunnels/*. Existing filename-only rules (e.g. *.txt). Previously, _walk() called _ignore(file_name) with only the bare filename, so subdirectory patterns never matched.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#182