From 37edd000ea6be778b9ee0ed8bf0b8b6274fdfc1e Mon Sep 17 00:00:00 2001 From: Jichen Dou Date: Fri, 8 May 2026 13:45:42 -0700 Subject: [PATCH] tools/pyang: exclude common YANG models from import to avoid duplicates Signed-off-by: Jichen Dou --- tools/pyang/import_yang.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/pyang/import_yang.py b/tools/pyang/import_yang.py index d4b7f690b..d4ea5174a 100755 --- a/tools/pyang/import_yang.py +++ b/tools/pyang/import_yang.py @@ -77,6 +77,8 @@ def __init__(self, files, options): ctx.keep_comments = options.keep_comments excludes = [f.stem for f in options.to_dir.glob("*.yang")] + # Exclude common yang-models since they are already included in sonic-mgmt-common + excludes += [f.stem for f in options.to_dir.glob("common/*.yang")] if options.exclude: excludes += [f.stem for f in options.exclude]