From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mail.openembedded.org (Postfix) with ESMTP id 66C2A77163 for ; Fri, 16 Oct 2015 20:28:07 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 16 Oct 2015 13:28:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,690,1437462000"; d="scan'208,217";a="828807964" Received: from besquive-mobl2.amr.corp.intel.com ([10.219.128.95]) by fmsmga002.fm.intel.com with ESMTP; 16 Oct 2015 13:28:06 -0700 Message-ID: <1445027286.6970.34.camel@linux.intel.com> From: Benjamin Esquivel To: Christopher Larson In-Reply-To: References: <1444930021-4096-1-git-send-email-benjamin.esquivel@linux.intel.com> Organization: Intel Corporation Date: Fri, 16 Oct 2015 15:28:06 -0500 Mime-Version: 1.0 X-Mailer: Evolution 3.16.5 (3.16.5-3.fc22) Cc: "paul.eggleton@linux.intel.com" , Patches and discussions about the oe-core layer Subject: Re: [PATCH] populate SDK: prepare calling of bb.utils for exceptions X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: benjamin.esquivel@linux.intel.com List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2015 20:28:07 -0000 Content-Type: multipart/alternative; boundary="=-l1jKpp85VYgqnvCCeEhF" --=-l1jKpp85VYgqnvCCeEhF Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit On Thu, 2015-10-15 at 19:15 -0700, Christopher Larson wrote: > > On Thu, Oct 15, 2015 at 10:27 AM, Benjamin Esquivel < > benjamin.esquivel@linux.intel.com> wrote: > > + def movefile(self, sourcefile, destdir): > > + try: > > + # FIXME: this check of movefile's return code to None > > should be > > + # fixed within the function to use only exceptions to > > signal when > > + # something goes wrong > > + if (bb.utils.movefile(sourcefile, destdir) == None): > > + raise Exception("moving {} to {} failed".format( > > + sourcefile, destdir)) > > + except Exception as e: > > + bb.warn(str(e)) > > + bb.error("unable to place {} in final SDK > > location".format( > > + sourcefile)) > > + > > + def mkdirhier(self, dirpath): > > + try: > > + bb.utils.mkdirhier(dirpath) > > + except OSError as e: > > + bb.warn(str(e)) > > + bb.error("cannot make dir for SDK: > > {}".format(dirpath)) > > > Shouldn't this be fatal? correct, will change to fatal. Thanks. --=-l1jKpp85VYgqnvCCeEhF Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 7bit
On Thu, 2015-10-15 at 19:15 -0700, Christopher Larson wrote:

On Thu, Oct 15, 2015 at 10:27 AM, Benjamin Esquivel <benjamin.esquivel@linux.intel.com> wrote:
+    def movefile(self, sourcefile, destdir):
+        try:
+            # FIXME: this check of movefile's return code to None should be
+            # fixed within the function to use only exceptions to signal when
+            # something goes wrong
+            if (bb.utils.movefile(sourcefile, destdir) == None):
+                raise Exception("moving {} to {} failed".format(
+                                        sourcefile, destdir))
+        except Exception as e:
+            bb.warn(str(e))
+            bb.error("unable to place {} in final SDK location".format(
+                        sourcefile))
+
+    def mkdirhier(self, dirpath):
+        try:
+            bb.utils.mkdirhier(dirpath)
+        except OSError as e:
+            bb.warn(str(e))
+            bb.error("cannot make dir for SDK: {}".format(dirpath))


Shouldn't this be fatal?
correct, will change to fatal. Thanks.
--=-l1jKpp85VYgqnvCCeEhF--