"No such file or directory" regex is check in genericunix.py so don't need to verify here in command.
"""
tar command module.
"""
-import re
from moler.cmd.unix.genericunix import GenericUnix
from moler.cmd.converterhelper import ConverterHelper
from moler.exceptions import CommandFailure
-from moler.exceptions import ParsingDone
-
__author__ = 'Yang Snackwell'
__copyright__ = 'Copyright (C) 2018, Nokia'
@@ -35,18 +32,9 @@ class Tar(GenericUnix):
return cmd
def on_new_line(self, line, is_full_line):
- try:
- self._parse_fail_return(line)
- except ParsingDone:
- pass
+ if not is_full_line:
+ return super(Tar, self).on_new_line(line, is_full_line)
return super(Tar, self).on_new_line(line, is_full_line)
-
- _re_failed_strings = re.compile("No such file or directory", re.IGNORECASE)
-
- def _parse_fail_return(self, line):
- if self._regex_helper.search_compiled(Tar._re_failed_strings, line):
- self.set_exception(CommandFailure(self, "command failed in line '{}'".format(line)))
- raise ParsingDone
COMMAND_OUTPUT = """
