VMM/handler: Small code cleanups. v0.6.x
authorPascal Volk <neverseen@users.sourceforge.net>
Sat, 07 Aug 2010 05:16:26 +0000
branchv0.6.x
changeset 351 4bba5fb90b78
parent 350 b7a4d7828608
child 352 22d115376e4d
VMM/handler: Small code cleanups.
VirtualMailManager/handler.py
--- a/VirtualMailManager/handler.py	Sat Aug 07 05:13:46 2010 +0000
+++ b/VirtualMailManager/handler.py	Sat Aug 07 05:16:26 2010 +0000
@@ -135,18 +135,11 @@
             try:
                 exec_ok(val)
             except VMMError, err:
-                if err.code is NO_SUCH_BINARY:
-                    raise VMMError(_(u"'%(binary)s' doesn't exist.\n"
-                                     u"(%(cfg_file)s: section 'bin', option "
-                                     u"'%(option)s')") % {'binary': val,
-                                   'cfg_file': self._cfg_fname, 'option': opt},
-                                   err.code)
-                elif err.code is NOT_EXECUTABLE:
-                    raise VMMError(_(u"'%(binary)s' is not executable.\n"
-                                     u"(%(cfg_file)s: section 'bin', option "
-                                     u"'%(option)s')") % {'binary': val,
-                                   'cfg_file': self._cfg_fname, 'option': opt},
-                                   err.code)
+                if err.code in (NO_SUCH_BINARY, NOT_EXECUTABLE):
+                    raise VMMError(err.msg + _(u"\n(%(cfg_file)s: section "
+                                   u"'bin', option '%(option)s')") %
+                                   {'cfg_file': self._cfg_fname,
+                                    'option': opt}, err.code)
                 else:
                     raise