CSIT-1338 FIX: Failed to get VPP version on host
[csit.git] / resources / libraries / python / CpuUtils.py
index 3cb4454..f4d52f8 100644 (file)
@@ -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)