From 638784627abc398719aee28d1e42e803d4a405f2 Mon Sep 17 00:00:00 2001 From: Andrew Walker Date: Thu, 4 Jul 2024 05:51:19 -0700 Subject: [PATCH] Fix REST methods with versioned API (#13977) Due to changes in behavior with new api_method decorator the _private attribute is always present for these methods and so we must explicitly check for whether it is True. --- src/middlewared/middlewared/service/core_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/middlewared/middlewared/service/core_service.py b/src/middlewared/middlewared/service/core_service.py index b3f1aaaf316d4..979bd9441147b 100644 --- a/src/middlewared/middlewared/service/core_service.py +++ b/src/middlewared/middlewared/service/core_service.py @@ -388,7 +388,7 @@ def get_methods(self, app, service, target): continue # Skip private methods - if hasattr(method, '_private'): + if hasattr(method, '_private') and method._private is True: continue if target == 'CLI' and hasattr(method, '_cli_private'): continue