diff --git a/lib/vdsm/v2v.py b/lib/vdsm/v2v.py index 2df126a368..a05d38313e 100644 --- a/lib/vdsm/v2v.py +++ b/lib/vdsm/v2v.py @@ -933,7 +933,7 @@ def _abort(self): class OutputParser(object): COPY_DISK_RE = re.compile(br'.*(Copying disk (\d+)/(\d+)).*') - DISK_PROGRESS_RE = re.compile(br'\s+\((\d+).*') + DISK_PROGRESS_RE = re.compile(br'\s+\((\d+).*|.+ (\d+)% \[[*-]+\]') def parse(self, stream): for line in stream: @@ -970,8 +970,9 @@ def _parse_progress(self, chunk): m = self.DISK_PROGRESS_RE.match(chunk) if m is None: return None + value = [x for x in m.groups() if x is not None][0] try: - return int(m.group(1)) + return int(value) except ValueError: raise OutputParserError('error parsing progress regex: %r' % m.groups)