Update connection plugins to use correct, non-deprecated, methods (#52038)

* Update connection plugins to use correct, non-deprecated, methods

* Update tests to reflect calling become plugins
This commit is contained in:
Matt Martz 2019-02-11 13:44:54 -06:00 committed by GitHub
parent d033884465
commit c55317a2bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 12 deletions

View file

@ -92,7 +92,7 @@ class Connection(ConnectionBase):
become_output = b''
try:
while not self.check_become_success(become_output) and not self.check_password_prompt(become_output):
while not self.become.check_success(become_output) and not self.become.check_password_prompt(become_output):
events = selector.select(self._play_context.timeout)
if not events:
stdout, stderr = p.communicate()
@ -111,7 +111,7 @@ class Connection(ConnectionBase):
finally:
selector.close()
if not self.check_become_success(become_output):
if not self.become.check_success(become_output):
p.stdin.write(to_bytes(self._play_context.become_pass, errors='surrogate_or_strict') + b'\n')
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)