From f4860dd541527328e56ddfb741be2ebad500e47f Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Thu, 13 Jan 2011 12:27:14 -0600 Subject: Component: Switch to pre-PEP318 function decorators Having the new style for function decorators causes issues when building the Bcfg2 client on CentOS 4 which is still shipping with python 2.3. This patch keeps the same functionality with the old syntax (can be reverted once we drop support for python 2.3 on the client). Signed-off-by: Sol Jerome --- src/lib/Component.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/Component.py b/src/lib/Component.py index 2a3ef20e1..33b1c9289 100644 --- a/src/lib/Component.py +++ b/src/lib/Component.py @@ -239,15 +239,14 @@ class Component (object): raise xmlrpclib.Fault(getattr(e, "fault_code", 1), str(e)) return result - @exposed def listMethods(self): """Custom XML-RPC introspective method list.""" return [ name for name, func in inspect.getmembers(self, callable) if getattr(func, "exposed", False) ] + listMethods = exposed(listMethods) - @exposed def methodHelp(self, method_name): """Custom XML-RPC introspective method help. @@ -260,6 +259,7 @@ class Component (object): except NoExposedMethod: return "" return pydoc.getdoc(func) + methodHelp = exposed(methodHelp) def get_name(self): """The name of the component.""" -- cgit v1.2.3-1-g7c22