comparison libervia/server/tasks.py @ 1189:170802865156

server (tasks): fixed findCommand when first name can't be found
author Goffi <goffi@goffi.org>
date Mon, 27 May 2019 09:06:45 +0200
parents 5baf7ece44a0
children b2d067339de3
comparison
equal deleted inserted replaced
1188:263fed3ce354 1189:170802865156
187 for n in names: 187 for n in names:
188 try: 188 try:
189 cmd_path = which(n)[0].encode('utf-8') 189 cmd_path = which(n)[0].encode('utf-8')
190 except IndexError: 190 except IndexError:
191 pass 191 pass
192 return cmd_path 192 else:
193 return cmd_path
193 raise exceptions.NotFound(_( 194 raise exceptions.NotFound(_(
194 u"Can't find {name} command, did you install it?").format(name=name)) 195 u"Can't find {name} command, did you install it?").format(name=name))
195 196
196 def runCommand(self, command, *args, **kwargs): 197 def runCommand(self, command, *args, **kwargs):
197 kwargs['verbose'] = self.task_data[u"LOG_OUTPUT"] 198 kwargs['verbose'] = self.task_data[u"LOG_OUTPUT"]