[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] xen/misra: xen-analysis.py: fix return error on PhaseExceptions


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Fri, 28 Apr 2023 05:31:39 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=C80hBpRfopBuAUbs21hwg3cF5r8UOx9NeTcCdymtSfs=; b=XH/yv4cprBDFDtxZI1FNL9Gsd0oCL2d9gPLCImjvuv+EKjD5F5Hubza7nICvH3PJ12xH+kR5A/IdYLlSQt5wd7g7pc1VlTIH/9/eBjwpUtzJ56sg2RlDONN+G+a2m3GzUCYa1DXw7kfcWldUNvPNxxpteF+miGIyvD1YAWQnpcHgWLcPpO3uryOH+XceNp8b4tQSeXLLrxLEQ8+NlOXsC+7fvxPBJUKU6JGv3P1tAIUqzOS1SBzgsR1dE+RJ2VWBtCmbrvct2tS4I3r4FVVyez+bUNOZgTXO4R8XV6QS7NbQkqZ7gMxIcVc3ZXMyeUVt9bmCbPXa8C/xBkAwtP5b1A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y63QRZwhapNVui/lakBfkpVSbakOVT6+n5ijtvirZKpGX3ZTC9+cfykbXuHxAmy1czBKEcQdj22Gas/lGkpUW9NWQK7liy47JV+QQszMu4+90uDq0/Eom1lGUEsv5Es2vJvfDls20DNSEscBZdhbRVXzMRbCpJ33cm7sZRDRQsF9+PQdZTfTKVfANCWJB6CZCSU/rli1PogJgj63oNagMVF0Nul6ZOZGGR/A4FKcaATbYlfv/DAgTMOxpNZBqxRYZbgVVyQV6RzjlBudBA97Y2FP9qExT0PRIFbVgnvOBFAWhPlZxy9igOHLRtvytF+mUxYHfwhqiLlgwPiMjtZl3Q==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>
  • Delivery-date: Fri, 28 Apr 2023 05:32:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZeQvr/NpTS3xi9kqkgHy5QIJUF68/lZYAgACdrgA=
  • Thread-topic: [PATCH v2] xen/misra: xen-analysis.py: fix return error on PhaseExceptions


> On 27 Apr 2023, at 21:07, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
> 
> On 27/04/2023 2:25 pm, Luca Fancellu wrote:
>> Currently the script return code is 0 even if an exception is
>> found, because the return code is written only if the exception
>> object has the errorcode member.
>> 
>> Fix the issue returning the errorcode member in case it exists,
>> otherwise use a generic value different from 0.
>> 
>> Fixes: 02b26c02c7c4 ("xen/scripts: add cppcheck tool to the xen-analysis.py 
>> script")
>> Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> 
>> Change-Id: I1b76b8fa4668bef49da3282339fca3052e3379cd
> 
> although this doesn't look like it should be here.  I've stripped it

My bad! I forgot to remove it before sending. Thanks

> 
> ~Andrew
> 
>> ---
>> Changes from v1:
>> - use getattr() (Andrew)
>> ---
>> xen/scripts/xen-analysis.py | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>> 
>> diff --git a/xen/scripts/xen-analysis.py b/xen/scripts/xen-analysis.py
>> index 8e50c27cd898..5e8f2910cd72 100755
>> --- a/xen/scripts/xen-analysis.py
>> +++ b/xen/scripts/xen-analysis.py
>> @@ -26,8 +26,7 @@ def main(argv):
>>             cppcheck_analysis.generate_cppcheck_report()
>>     except PhaseExceptions as e:
>>         print("ERROR: {}".format(e))
>> -        if hasattr(e, "errorcode"):
>> -            ret_code = e.errorcode
>> +        ret_code = getattr(e, "errorcode", 1)
>>     finally:
>>         if settings.step_clean_analysis:
>>             cppcheck_analysis.clean_analysis_artifacts()
> 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.