Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 74AB5E00CE1; Mon, 31 Oct 2016 03:17:19 -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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 5F581E00C86 for ; Mon, 31 Oct 2016 03:17:17 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP; 31 Oct 2016 03:17:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,426,1473145200"; d="scan'208";a="895945403" Received: from linux.intel.com ([10.54.29.200]) by orsmga003.jf.intel.com with ESMTP; 31 Oct 2016 03:17:17 -0700 Received: from vmed.fi.intel.com (vmed.fi.intel.com [10.237.72.68]) by linux.intel.com (Postfix) with ESMTP id 104B36A4080; Mon, 31 Oct 2016 03:16:33 -0700 (PDT) From: Ed Bartosh To: toaster@yoctoproject.org Date: Mon, 31 Oct 2016 12:16:38 +0200 Message-Id: <45aa99e37b418f73742d539239d9500a930cc0ae.1477908230.git.ed.bartosh@linux.intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [PATCH 1/4] toaster: use current directory if BUILDDIR is not set 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: Mon, 31 Oct 2016 10:17:19 -0000 If BUILDDIR environment variable is not set signal_runbuilds function throws TypeError as os.getenv('BUILDDIR') returns None: ERROR: unsupported operand type(s) for +=: 'NoneType' and 'str' Traceback (most recent call last): File "bitbake/lib/bb/ui/toasterui.py", line 391, in main buildinfohelper.update_build_information(event, errors, warnings, taskfailures) File "bitbake/lib/bb/ui/buildinfohelper.py", line 1184, in update_build_information self.internal_state['build'], errors, warnings, taskfailures) File "bitbake/lib/bb/ui/buildinfohelper.py", line 238, in update_build_stats_and_outcome signal_runbuilds() File "bitbake/lib/toaster/orm/models.py", line 1746, in signal_runbuilds '.runbuilds.pid')) as pidf: File "/usr/lib64/python3.4/posixpath.py", line 82, in join path += b TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str' Used os.getenv('BUILDIR', '.') to make it always return meaningful directory path. Current directory '.' will be used if BUILDDIR is not set. Signed-off-by: Ed Bartosh --- bitbake/lib/toaster/orm/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 9a4db1e..4f8510c 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -1742,7 +1742,7 @@ def invalidate_cache(**kwargs): def signal_runbuilds(): """Send SIGUSR1 to runbuilds process""" try: - with open(os.path.join(os.getenv('BUILDDIR'), + with open(os.path.join(os.getenv('BUILDDIR', '.'), '.runbuilds.pid')) as pidf: os.kill(int(pidf.read()), SIGUSR1) except FileNotFoundError: -- 2.1.4