simplify become testing and handling, we had drifted and were doulbe checking prompt, become and become_pass

fixed tests to conform to new signature and now tests both with and w/o password
now we are more explicit about self.prompt
This commit is contained in:
Brian Coca 2015-09-04 09:30:31 -04:00
parent eb0e7e198b
commit c17fbf2f12
5 changed files with 77 additions and 71 deletions

View file

@ -70,7 +70,7 @@ class Connection(ConnectionBase):
)
self._display.debug("done running command with Popen()")
if self._play_context.prompt and self._play_context.become_pass and sudoable:
if self._play_context.prompt and sudoable:
fcntl.fcntl(p.stdout, fcntl.F_SETFL, fcntl.fcntl(p.stdout, fcntl.F_GETFL) | os.O_NONBLOCK)
fcntl.fcntl(p.stderr, fcntl.F_SETFL, fcntl.fcntl(p.stderr, fcntl.F_GETFL) | os.O_NONBLOCK)
become_output = ''