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.""" |