From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id ACBD0E008D4; Tue, 14 Jul 2015 04:18:30 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.223.180 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 HTML_MESSAGE BODY: HTML included in message Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 60C73E0086E for ; Tue, 14 Jul 2015 04:18:22 -0700 (PDT) Received: by ieik3 with SMTP id k3so8845539iei.3 for ; Tue, 14 Jul 2015 04:18:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=fanZLVZcnSkHwTA9TfWGz72h4qiCtYbaZ8fWBJRtPpo=; b=ct9uKzWXkNds3dOW+d/TsSIWawWSQAyZUNcHTos1X+AbuArzaFXylbS40R+E243zvf uhvwYyQOF8GSESoItPZlZIvEdLqPxvbbkbORa+k4VVViUlXG6QZb0zZB9IQbeiQ9Vpje c5buhYLkfFgdvMlykER13fQrowRrpHS9gneCiCz2AmDunI/V6dTk/1ZgxXH2gvw1UOBx RpFSr9Ahr9xr4bfAk3UMbZ2SNwECBXWHJXfXfLVSpl+FT/wYcBPFNyWTCZzu5AsZUE8R d8yGujBy8Zdmf6iVKpUDNlGWj2RdG6k227caeZFRANpJoXVivRDKZJ3vzjIlln+SxdjL K24A== X-Gm-Message-State: ALoCoQniD9ae26wZiYV1dOrxyYlCtuYh3DRmwBdrFgnmfLOk6gqGDGJU5UtVD4s3NKR5sX6/9krg X-Received: by 10.50.1.115 with SMTP id 19mr16573025igl.67.1436872702218; Tue, 14 Jul 2015 04:18:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.65.207 with HTTP; Tue, 14 Jul 2015 04:18:02 -0700 (PDT) In-Reply-To: <55A3EBB9.5060109@intel.com> References: <20150710144844.GA14439@linux.intel.com> <55A3EBB9.5060109@intel.com> From: "Damian, Alexandru" Date: Tue, 14 Jul 2015 12:18:02 +0100 Message-ID: To: Michael Wood Cc: "toaster@yoctoproject.org" Subject: Re: [review-request] ed/toaster/misc X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jul 2015 11:18:30 -0000 Content-Type: multipart/alternative; boundary=047d7bdc110e00f0a2051ad3ffde --047d7bdc110e00f0a2051ad3ffde Content-Type: text/plain; charset=UTF-8 Hi, I have some comments below: *toaster: get rid of _createdirpath function* os.mkdirs is missing the mode specification; I am not sure it matters, though. *toaster: Wait for toaster gui to come* I am not sure which logger should to be used here; the reason for changing the logger in the first place (which was originally defined as "BitBake" was that the "BitBake" logger settings are modified in bitbake/lib/bb/__init__.py, and it is targeted at the inner Bitbake core; some updates there changed the original output, with output disappearing from the console being an obvious effect. Messing with "BitBake" logger settings with this may have side effects throught the bitbake code, so I refrained from touching that I considered using the "toaster" logger that is defined in bitbake/lib/toaster/toastermain/settings.py and outputs strictly to console; I felt likewise reluctant to use this logger because changing it to output to a file would be affect the way the django application is logging. ToasterLogger is not defined anywhere, and this is why I used it here. I am not sure I understand the root cause of why the code breaks when using "ToasterLogger" instead of "BitBake"; can you please assess the root cause and get a solution to have messages properly logged to the toaster_ui.log file using a logger that's not BitBake ? Otherwise, all fine. Thank you, Alex On Mon, Jul 13, 2015 at 5:47 PM, Michael Wood wrote: > On 10/07/15 15:48, Ed Bartosh wrote: > >> Hi reviewers, >> >> Please review fix for YOCTO: #7965: Wait for toaster gui to come >> and couple of other changes: >> 1. tiny refactoring change: get rid of _createdirpath function >> 2. and small fix: Fix usage of wrong variables >> >> -- >> Regards, >> Ed >> > > * 7cee08d toaster: get rid of _createdirpath function > * eae47f7 toaster: Fix usage of wrong variables > * 321d6ae toaster: Wait for toaster gui to come > > Looks fine to me, though not familiar enough with build stuff to fully OK > this branch. > > 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 > > Thanks, > > Michael > > -- > _______________________________________________ > toaster mailing list > toaster@yoctoproject.org > https://lists.yoctoproject.org/listinfo/toaster > -- Alex Damian Yocto Project SSG / OTC --047d7bdc110e00f0a2051ad3ffde Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

I have some comments below:

toaster: get ri= d of _createdirpath function

=C2=A0=C2=A0=C2=A0 os.mkdirs is mis= sing the mode specification; I am not sure it matters, though.


<= i>toaster: Wait for toaster gui to come
=C2=A0
=C2=A0 I am not = sure which logger should to be used here; the reason for changing the logge= r in the first place (which was originally defined as "BitBake" w= as that the "BitBake" logger settings are modified in bitbake/lib= /bb/__init__.py, and it is targeted at the inner Bitbake core; some updates= there changed the original output, with output disappearing from the conso= le being an obvious effect.
Messing with "BitBake" logger sett= ings with=C2=A0 this may have side effects throught the bitbake code, so I = refrained from touching that

=C2=A0 I considered using the "to= aster" logger that is defined in bitbake/lib/toaster/toastermain/setti= ngs.py and outputs strictly to console; I felt likewise reluctant to use th= is logger because changing it to output to a file would be affect the way t= he django application is logging.

=C2=A0 ToasterLogger is not define= d anywhere, and this is why I used it here. I am not sure I understand the = root cause of why the code breaks when using "ToasterLogger" inst= ead of "BitBake"; can you please assess the root cause and get a = solution to have messages properly logged to the toaster_ui.log file using = a logger that's not BitBake ?


Otherwise, all fine.
=

Th= ank you,
Alex



On Mon, Jul 13, 2015 at 5:47 PM, Michael Wood <michael.g.wood@intel.com> wrote:
On 10/07/15 15:48, Ed Bartosh wrote:
Hi reviewers,

Please review fix for YOCTO: #7965: Wait for toaster gui to come
and couple of other changes:
1. tiny refactoring change:=C2=A0 get rid of _createdirpath function
2. and small fix: Fix usage of wrong variables

--
Regards,
Ed

* 7cee08d toaster: get rid of _createdirpath function
* eae47f7 toaster: Fix usage of wrong variables
* 321d6ae toaster: Wait for toaster gui to come

Looks fine to me, though not familiar enough with build stuff to fully OK t= his branch.

While you're in localhostbecontroller

We could also get rid of

=C2=A0 =C2=A0 def _shellcmd(self, command, cwd =3D None):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if cwd is None:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 cwd =3D self.be.sourcedir

=C2=A0 =C2=A0 =C2=A0 =C2=A0 #logger.debug("lbc_shellcmmd: (%s) %s"= ; % (cwd, command))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 p =3D subprocess.Popen(command, cwd =3D cwd, sh= ell=3DTrue, stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.PIPE)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (out,err) =3D p.communicate()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 p.wait()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if p.returncode:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if len(err) =3D=3D 0:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 err =3D "comma= nd: %s \n%s" % (command, out)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 err =3D "comma= nd: %s \n%s" % (command, err)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 #logger.warn("localhostbecon= troller: shellcmd error %s" % err)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 raise ShellCmdException(err)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 else:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 #logger.debug("localhostbeco= ntroller: shellcmd success")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return out


I believe with:

subprocess.check_output

Thanks,

Michael

--
_______________________________________________
toaster mailing list
toaster@yocto= project.org
https://lists.yoctoproject.org/listinfo/toaster



--
Alex Damian
Yocto Project
SSG / OTC=C2=A0
--047d7bdc110e00f0a2051ad3ffde--