[Toaster] [review-request] ed/toaster/misc

Ed Bartosh ed.bartosh at linux.intel.com
Tue Jul 14 06:06:36 PDT 2015


Hi Michael,

Thanks for the review.

...

> While you're in localhostbecontroller
> 
> We could also get rid of
> 
>     def _shellcmd(self, command, cwd = None):
>         if cwd is None:
>             cwd = self.be.sourcedir
> 
>         #logger.debug("lbc_shellcmmd: (%s) %s" % (cwd, command))
>         p = subprocess.Popen(command, cwd = cwd, shell=True,
> stdout=subprocess.PIPE, stderr=subprocess.PIPE)
>         (out,err) = p.communicate()
>         p.wait()
>         if p.returncode:
>             if len(err) == 0:
>                 err = "command: %s \n%s" % (command, out)
>             else:
>                 err = "command: %s \n%s" % (command, err)
>             #logger.warn("localhostbecontroller: shellcmd error %s" % err)
>             raise ShellCmdException(err)
>         else:
>             #logger.debug("localhostbecontroller: shellcmd success")
>             return out
> 
> 
> I believe with:
> 
> subprocess.check_output
> 
Yep, I've noticed this too. I think the reason for not using
check_output was that it doesn't have cwd parameter.

I'm planning to generalize build controllers, so I'll make much more
changes to this code anyway. Hopefully it will be for good :)
Just discussed this with Alex and he seems to be ok with this.

--
Regards,
Ed


More information about the toaster mailing list