forked from ansible/ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for run_command tests now that it returns native strings
- Loading branch information
Showing
3 changed files
with
21 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
# to the complete work. | ||
# | ||
# Copyright (c), Michael DeHaan <[email protected]>, 2012-2013 | ||
# Copyright (c), Toshio Kuratomi <[email protected]> 2016 | ||
# All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without modification, | ||
|
@@ -2240,6 +2241,10 @@ def run_command(self, args, check_rc=False, close_fds=True, executable=None, dat | |
# if we're checking for prompts, do it now | ||
if prompt_re: | ||
if prompt_re.search(stdout) and not data: | ||
if encoding: | ||
stdout = to_native(stdout, encoding=encoding, errors=errors) | ||
else: | ||
stdout = stdout | ||
return (257, stdout, "A prompt was encountered while running a command, but no input data was specified") | ||
# only break out if no pipes are left to read or | ||
# the pipes are completely read and | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters