X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FCpuUtils.py;h=f4d52f866298882201c4ad56b4403a87d0a57a3f;hb=68a4959b2f4b23ecf1c894c10a365fbdbb3dbf6a;hp=3cb4454e6c646f507afba531b1483a3c3838491d;hpb=21702fb09c470511cc3ed7b34ca5ab0f8d30b68f;p=csit.git diff --git a/resources/libraries/python/CpuUtils.py b/resources/libraries/python/CpuUtils.py index 3cb4454e6c..f4d52f8662 100644 --- a/resources/libraries/python/CpuUtils.py +++ b/resources/libraries/python/CpuUtils.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Cisco and/or its affiliates. +# Copyright (c) 2018 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -82,7 +82,7 @@ class CpuUtils(object): ret, stderr)) node['cpuinfo'] = list() for line in stdout.split("\n"): - if len(line) > 0 and line[0] != "#": + if line and line[0] != "#": node['cpuinfo'].append([CpuUtils.__str2int(x) for x in line.split(",")]) @@ -114,8 +114,8 @@ class CpuUtils(object): :type smt_used: bool :returns: List of cpu numbers related to numa from argument. :rtype: list of int - :raises RuntimeError: If node cpuinfo is not available or if SMT is not - enabled. + :raises RuntimeError: If node cpuinfo is not available + or if SMT is not enabled. """ cpu_node = int(cpu_node)