summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2011-01-13 12:27:14 -0600
committerSol Jerome <sol.jerome@gmail.com>2011-01-13 12:27:14 -0600
commitf4860dd541527328e56ddfb741be2ebad500e47f (patch)
tree067885708b97331651fb43445103fc497d15e8c8
parent201e98f9a0078c34cb6c26261259db654bcc7e9f (diff)
downloadbcfg2-f4860dd541527328e56ddfb741be2ebad500e47f.tar.gz
bcfg2-f4860dd541527328e56ddfb741be2ebad500e47f.tar.bz2
bcfg2-f4860dd541527328e56ddfb741be2ebad500e47f.zip
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 <sol.jerome@gmail.com>
-rw-r--r--src/lib/Component.py4
1 files 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."""