Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit de432ed

Browse files
execute_utility2 is updated (ignore_errors) (#201)
- New parameters "ignore_errors" is added. Default value is False. - Asserts are added.
1 parent 3cc1627 commit de432ed

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

testgres/utils.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,13 @@ def execute_utility(args, logfile=None, verbose=False):
7373
return execute_utility2(tconf.os_ops, args, logfile, verbose)
7474

7575

76-
def execute_utility2(os_ops: OsOperations, args, logfile=None, verbose=False):
76+
def execute_utility2(os_ops: OsOperations, args, logfile=None, verbose=False, ignore_errors=False):
7777
assert os_ops is not None
7878
assert isinstance(os_ops, OsOperations)
79+
assert type(verbose) == bool # noqa: E721
80+
assert type(ignore_errors) == bool # noqa: E721
7981

80-
exit_status, out, error = os_ops.exec_command(args, verbose=True)
82+
exit_status, out, error = os_ops.exec_command(args, verbose=True, ignore_errors=ignore_errors)
8183
# decode result
8284
out = '' if not out else out
8385
if isinstance(out, bytes):

0 commit comments

Comments
 (0)