Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing the escape sequence from the output of get_cpu_count()! #4051

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion virttest/virt_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import six
from aexpect import remote
from aexpect.exceptions import ExpectError, ShellError
from aexpect.utils import astring
from avocado.core import exceptions
from six.moves import xrange

Expand Down Expand Up @@ -1564,7 +1565,9 @@ def get_cpu_count(self, check_cmd="cpu_chk_cmd", connect_uri=None):
"""
cmd = self.params.get(check_cmd)
out = self.session.cmd_output_safe(cmd)
return int(re.search("\d+", out, re.M).group())
# Removing the escape sequence from the output
out_no_escape = astring.strip_console_codes(out)
return int(re.search("\d+", out_no_escape, re.M).group())

def get_memory_size(self, cmd=None, timeout=60):
"""
Expand Down