VirtualMailManager/handler.py
branchv0.6.x
changeset 351 4bba5fb90b78
parent 341 6709d0faf2f5
child 355 48bf20b43f2e
equal deleted inserted replaced
350:b7a4d7828608 351:4bba5fb90b78
   133                            NO_SUCH_DIRECTORY)
   133                            NO_SUCH_DIRECTORY)
   134         for opt, val in self._cfg.items('bin'):
   134         for opt, val in self._cfg.items('bin'):
   135             try:
   135             try:
   136                 exec_ok(val)
   136                 exec_ok(val)
   137             except VMMError, err:
   137             except VMMError, err:
   138                 if err.code is NO_SUCH_BINARY:
   138                 if err.code in (NO_SUCH_BINARY, NOT_EXECUTABLE):
   139                     raise VMMError(_(u"'%(binary)s' doesn't exist.\n"
   139                     raise VMMError(err.msg + _(u"\n(%(cfg_file)s: section "
   140                                      u"(%(cfg_file)s: section 'bin', option "
   140                                    u"'bin', option '%(option)s')") %
   141                                      u"'%(option)s')") % {'binary': val,
   141                                    {'cfg_file': self._cfg_fname,
   142                                    'cfg_file': self._cfg_fname, 'option': opt},
   142                                     'option': opt}, err.code)
   143                                    err.code)
       
   144                 elif err.code is NOT_EXECUTABLE:
       
   145                     raise VMMError(_(u"'%(binary)s' is not executable.\n"
       
   146                                      u"(%(cfg_file)s: section 'bin', option "
       
   147                                      u"'%(option)s')") % {'binary': val,
       
   148                                    'cfg_file': self._cfg_fname, 'option': opt},
       
   149                                    err.code)
       
   150                 else:
   143                 else:
   151                     raise
   144                     raise
   152 
   145 
   153     def _db_connect(self):
   146     def _db_connect(self):
   154         """Creates a pyPgSQL.PgSQL.connection instance."""
   147         """Creates a pyPgSQL.PgSQL.connection instance."""