summaryrefslogtreecommitdiffstats
path: root/ipaserver/rpcserver.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2009-10-15 15:00:57 -0600
committerJason Gerard DeRose <jderose@redhat.com>2009-10-15 15:00:57 -0600
commit5fad455ff41c7ab8acb8b41ea1c9c752830ce1ea (patch)
treebd6385bffd0b1cbe80c94f2dabc6e7ae65b02f5a /ipaserver/rpcserver.py
parent8dc21d6f30d1466f07b38e0d015de39a8c0d29d2 (diff)
downloadfreeipa-5fad455ff41c7ab8acb8b41ea1c9c752830ce1ea.tar.gz
freeipa-5fad455ff41c7ab8acb8b41ea1c9c752830ce1ea.tar.xz
freeipa-5fad455ff41c7ab8acb8b41ea1c9c752830ce1ea.zip
Fixed try/except/finally for Python 2.4 compatability
Diffstat (limited to 'ipaserver/rpcserver.py')
-rw-r--r--ipaserver/rpcserver.py39
1 files changed, 20 insertions, 19 deletions
diff --git a/ipaserver/rpcserver.py b/ipaserver/rpcserver.py
index 06fb5aeea..72f221992 100644
--- a/ipaserver/rpcserver.py
+++ b/ipaserver/rpcserver.py
@@ -103,25 +103,26 @@ class WSGIExecutioner(Executioner):
error = None
_id = None
try:
- self.create_context(ccache=environ.get('KRB5CCNAME'))
- if (
- environ.get('CONTENT_TYPE', '').startswith(self.content_type)
- and environ['REQUEST_METHOD'] == 'POST'
- ):
- data = read_input(environ)
- (name, args, options, _id) = self.unmarshal(data)
- else:
- (name, args, options, _id) = self.simple_unmarshal(environ)
- if name not in self.Command:
- raise CommandError(name=name)
- result = self.Command[name](*args, **options)
- except PublicError, e:
- error = e
- except StandardError, e:
- self.exception(
- 'non-public: %s: %s', e.__class__.__name__, str(e)
- )
- error = InternalError()
+ try:
+ self.create_context(ccache=environ.get('KRB5CCNAME'))
+ if (
+ environ.get('CONTENT_TYPE', '').startswith(self.content_type)
+ and environ['REQUEST_METHOD'] == 'POST'
+ ):
+ data = read_input(environ)
+ (name, args, options, _id) = self.unmarshal(data)
+ else:
+ (name, args, options, _id) = self.simple_unmarshal(environ)
+ if name not in self.Command:
+ raise CommandError(name=name)
+ result = self.Command[name](*args, **options)
+ except PublicError, e:
+ error = e
+ except StandardError, e:
+ self.exception(
+ 'non-public: %s: %s', e.__class__.__name__, str(e)
+ )
+ error = InternalError()
finally:
destroy_context()
return self.marshal(result, error, _id)