aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/network_services/helpers
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-08-20 22:09:33 -0700
committerRoss Brattain <ross.b.brattain@intel.com>2017-08-21 20:12:32 -0700
commitbb3ad3827f02bb27bcc84e191afc27ddd2da38b2 (patch)
treede4775b5f606a9a2c700ee9c9ec8b3d00a0973b5 /yardstick/network_services/helpers
parente71da0adfe3fae77311d7a75c5a74b87dfa0890e (diff)
ssh: add new get_file_obj method to fetch remote files
We can either cat remote files, or we can just sftp get them. use sftp get for /proc/cpuinfo since it can be so very large on systems with 88+ cores. Change-Id: I420b8c5eefdce8bb3e3b13dcc8257583dee537c1 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Diffstat (limited to 'yardstick/network_services/helpers')
-rw-r--r--yardstick/network_services/helpers/cpu.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/yardstick/network_services/helpers/cpu.py b/yardstick/network_services/helpers/cpu.py
index a5ba6c31e..8c21754ff 100644
--- a/yardstick/network_services/helpers/cpu.py
+++ b/yardstick/network_services/helpers/cpu.py
@@ -13,6 +13,9 @@
# limitations under the License.
+import io
+
+
class CpuSysCores(object):
def __init__(self, connection=""):
@@ -20,8 +23,9 @@ class CpuSysCores(object):
self.connection = connection
def _open_cpuinfo(self):
- lines = []
- lines = self.connection.execute("cat /proc/cpuinfo")[1].split(u'\n')
+ cpuinfo = io.BytesIO()
+ self.connection.get_file_obj("/proc/cpuinfo", cpuinfo)
+ lines = cpuinfo.getvalue().decode('utf-8').splitlines()
return lines
def _get_core_details(self, lines):