Skip to content

execute_utility2 is updated (ignore_errors) #201

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

Merged
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
6 changes: 4 additions & 2 deletions testgres/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ def execute_utility(args, logfile=None, verbose=False):
return execute_utility2(tconf.os_ops, args, logfile, verbose)


def execute_utility2(os_ops: OsOperations, args, logfile=None, verbose=False):
def execute_utility2(os_ops: OsOperations, args, logfile=None, verbose=False, ignore_errors=False):
assert os_ops is not None
assert isinstance(os_ops, OsOperations)
assert type(verbose) == bool # noqa: E721
assert type(ignore_errors) == bool # noqa: E721

exit_status, out, error = os_ops.exec_command(args, verbose=True)
exit_status, out, error = os_ops.exec_command(args, verbose=True, ignore_errors=ignore_errors)
# decode result
out = '' if not out else out
if isinstance(out, bytes):
Expand Down